Edgewall Software

source: trunk/bitten/build/hgtools.py @ 1001

Last change on this file since 1001 was 964, checked in by osimons, 13 years ago

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.

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/python-source
File size: 770 bytes
CovLine 
1# -*- coding: utf-8 -*-
2
13"""Recipe commands for Mercurial."""
4
15import logging
6
17log = logging.getLogger('bitten.build.hgtools')
8
19__docformat__ = 'restructuredtext en'
10
111def 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
17    :param dir\_: the name of a local subdirectory containing the working copy
18    """
019    args = ['pull', '-u']
020    if revision:
021        args += ['-r', revision.split(':')[-1]]
22
023    from bitten.build import shtools
024    returncode = shtools.execute(ctxt, file_='hg', args=args, dir_=dir_)
025    if returncode != 0:
026        ctxt.error('hg pull -u failed (%s)' % returncode)
27
Note: See TracBrowser for help on using the repository browser.