A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 year.hgignore for a CakePHP application? - page 1
User InfoPosts
.hgignore for a CakePHP application?#1
We(re using CakePHP for a new application, and we use Mercurial as the source control tool. (Mercurial uses one .hgignore file in the root directory, unlike (for example) CVS that uses .cvsignore in any directory.)

I(d like to exclude the content of the app/tmp/ directory from the source control (since they change all the time, and can be regenerated), but I can(t add app/tmp/* to .hgignore, since then the standard directories under tmp (cache, logs, sessions, tests, and also cache/models, cache/persistent, ...) would be missing from new clones made by hg clone, resulting in errors.

Currently I have in my hgignore:


It would be good to have a "standard" one that could be used in all projects. Can someone suggest a complete solution?

posted date: 2009-04-10 10:37:00

Re: .hgignore for a CakePHP application?#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-10 10:37:01

Re: .hgignore for a CakePHP application?#3
If I understand the question correctly you want to ignore file in tmp, but not files in certain directories in tmp. If that(s right then I think you can do so using this:syntax: regexp^tmp/(?!(cache|logs|sessions|test))That says ignore anything that starts with tmp, unless the next part is cache, log, sessions, test. For these files:.`-- tmp |-- cache | `-- afile `-- tmpfilehere is the hg stat result:$ hg stat? .hgignore? tmp/cache/afileI will note, though, that Cake is probably telling you not to put those files into source control based ont heir being in a tmp directory. Are you sure they(re not something htat your build system is supposed to create? Sessions in particular sound pretty transitory.

posted date: 2009-04-11 10:29:00

Re: .hgignore for a CakePHP application?#4
You can addsyntax: globapp/tmp/**to your .hgignore file and Mercurial will from that point on ignore all files under app/tmp/ with the exception of files tracked by Mercurial. See hg help patterns for more about file name patterns.So if you do% touch app/tmp/cache/.empty% touch app/tmp/logs/.empty% hg add app/tmp/cache/.empty% hg add app/tmp/logs/.emptyand make a clone, then the app/tmp/cache and app/tmp/logs directories will be created and new files in those directories will be ignored. I think that is what you want?This is also useful for tracking something like $HOME since you would want to ignore most files by default and only track explicitly added files.

posted date: 2009-05-22 00:55:00

Re: .hgignore for a CakePHP application?#5
In my own checkouts (from SVN), when the site was deployed, the ./tmp/ directory needed to have some specific permissions.I removed it from version control entirely, and my deployment script created the directories as required.

posted date: 2009-06-02 09:13:00

Re: .hgignore for a CakePHP application?#6
That is exactly what I do when using CakePHP, but I use Git and not Mercurial. This way the folder structure is maintained but the actual contents of the directories are not saved.

posted date: 2009-06-11 08:03:00

select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.