views:

135

answers:

2

I am looking for a step-by-step Mercurial guide for iPhone projects. Please assume:

  • hg already installed
  • the audience is comfortable with command line operations
  • everything is on OS X

As a newbie, I am particular interested in:

  • what files should be excluded
  • how to exclude above files
  • guideline/suggestion of naming builds
  • any relevant experience to share with

Please do not discuss how hg is better/worse than any other SCS. This is a how-to question, not a why question.

Thanks!

+1  A: 

Files you should exclude are: .DS_Store build *.mode1v3 *.pbxuser. You can also always ignore stuff from other SCSs like .git and .svn. I also ignore .LSOverride which is in some of my projects since I have multiple installs of the developer tools (for SDK betas) and sometimes want to override the standard launch service behavior.

These files can be ignored by listing them in a .hgignore file in the root of the working directory. The .hgignore file must be created manually. It is typically put under version control, so that the settings will propagate to other repositories with push and pull [1].

stigi
If I have multiple targets with different build folders, e.g.: build, build-os4, build-lite, does `build*` in `.hgignore` will get the 3 excluded?
ohho
Usually different targets create different folders inside the build folder, and in this case including just `build` is perfectly fine. But in the (rare) case you set different build folders for each target (is that even possible? ;) ) `build*` will include them all. See http://www.selenic.com/mercurial/hgignore.5.html on how wildcards and regular expressions apply.
stigi
If you specify the glob syntax (`syntax: glob`), then yes: `build*` will exclude all files or folders starting with the string `build`.
Santa
+1  A: 

A more general exclusion tip that applies to all source-control systems is that it's really useful to set up Xcode to use a shared build directory somewhere away from the source code. I prefer to use /Users/Shared/builds/ but it could go anywhere. The nice thing is that you don't need to bother excluding build products from hg, and it makes it convenient to exclude them from backups as well.

You can set this up in Xcode's preferences, under "building".

Tom Harrington