In article <aanlktiktvxsrmlw0z8ifvz3lkaedv8vui_a4f-oci...@mail.gmail.com>, Nick Coghlan <ncogh...@gmail.com> wrote: > Mercurial isn't really all that different, but it's distributed nature > means it want to keep track of even minor things like the local > whitespace fixes and the merger of your changes with the other changes > that were pushed since you started work. So the example above becomes > something like: > > hg pull -u > #change stuff > hg commit -m "Whatever" > hg push > # get rejected by server side hooks (e.g. changed files, bad whitespace) > make patchcheck > hg commit -m "Fix whitespace" > hg pull -u > hg merge > # Resolve any conflicts, rerun relevant tests > hg commit -m "Merge with remote" > hg push
As a side note, if you are prone to accidentally adding extra whitespace (like I am), you can add the whitespace check hook into your local copy of Mercurial so that you will be warned about whitespace problems immediately when you commit things to your local repos rather than later when you try to push them up to the python.org repo. You will need to add checkwhitsepace.py and reindent.py from the official hooks repo into the site-packages directory of the Python instance where your copy of hg is installed and then configure the hook in an hgrc configuration file. On a Unix-y system, here is one way to do it (no warranty on the installation instructions!): # try to avoid permission problems umask 022 hg clone http://hg.python.org/hooks cd hooks # make a dummy setup.py file for distutils cat >setup.py <<EOF1 from distutils.core import setup setup(name='pydevhooks', version='0.1', py_modules=['checkwhitespace', 'reindent'], ) EOF1 # kludge to find the Python instance which your hg uses HGPYTHON=$(head -1 $(which hg) | sed s'/#!//') echo $HGPYTHON # install the hooks sudo $HGPYTHON setup.py install # configure the hooks in your global .hgrc file -> affects all hg repos HGRC=~/.hgrc # ... or configure in specific repos #HGRC=/path/to/your_repo/.hg/hgrc cat >>$HGRC <<EOF2 [hooks] pretxncommit.whitespace = python:checkwhitespace.check_whitespace_single EOF2 -- Ned Deily, n...@acm.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com