Mercurial > bitten > bitten-test
annotate bitten/build/hgtools.py @ 885:f703a0bf6548
Fix `hg:pull` compat with Trac 0.12 as that changes how Mercurial revisions numbers are used.
Closes #638. Thanks to krigstask for report and patch.
author | osimons |
---|---|
date | Fri, 10 Dec 2010 09:33:37 +0000 |
parents | 9b5630fdd35e |
children |
rev | line source |
---|---|
556 | 1 # -*- coding: utf-8 -*- |
2 | |
3 """Recipe commands for Mercurial.""" | |
4 | |
5 import logging | |
6 | |
7 log = logging.getLogger('bitten.build.hgtools') | |
8 | |
9 __docformat__ = 'restructuredtext en' | |
10 | |
11 def pull(ctxt, revision=None, dir_='.'): | |
12 """pull and update the local working copy from the Mercurial repository. | |
13 | |
14 :param ctxt: the build context | |
15 :type ctxt: `Context` | |
16 :param revision: the revision to check out | |
677
639e5c466c96
0.6dev: Documentation fixes for all `build_doc` errors and warnings.
osimons
parents:
556
diff
changeset
|
17 :param dir\_: the name of a local subdirectory containing the working copy |
556 | 18 """ |
19 args = ['pull', '-u'] | |
20 if revision: | |
885
f703a0bf6548
Fix `hg:pull` compat with Trac 0.12 as that changes how Mercurial revisions numbers are used.
osimons
parents:
731
diff
changeset
|
21 args += ['-r', revision.split(':')[-1]] |
556 | 22 |
23 from bitten.build import shtools | |
729
6b3de00356d1
Changed how `hg:pull` works with disk location - repository directory can't be an argument, instead we need to change the working directory. Closes #530.
osimons
parents:
677
diff
changeset
|
24 returncode = shtools.execute(ctxt, file_='hg', args=args, dir_=dir_) |
556 | 25 if returncode != 0: |
26 ctxt.error('hg pull -u failed (%s)' % returncode) | |
27 |