comparison hglib/client.py @ 171:2725547a5f92 2.0

commit: allow rev and node to be anywhere in the output a01d3d32b53a in hg changed the output of commit --debug so the committed changeset isn't necessarily the last line.
author Idan Kamara <idankk86@gmail.com>
date Thu, 31 Dec 2015 16:53:51 -0800
parents e6589149b2c8
children c16e2087660f
comparison
equal deleted inserted replaced
170:ffca01835a7c 171:2725547a5f92
566 # --debug will print the committed cset 566 # --debug will print the committed cset
567 args = cmdbuilder(b('commit'), debug=True, m=message, A=addremove, 567 args = cmdbuilder(b('commit'), debug=True, m=message, A=addremove,
568 close_branch=closebranch, d=date, u=user, l=logfile, 568 close_branch=closebranch, d=date, u=user, l=logfile,
569 I=include, X=exclude, amend=amend) 569 I=include, X=exclude, amend=amend)
570 out = self.rawcommand(args) 570 out = self.rawcommand(args)
571 rev, node = out.splitlines()[-1].rsplit(b(':')) 571 m = re.search(b(r'^committed changeset (\d+):([0-9a-f]+)'), out,
572 return int(rev.split()[-1]), node 572 re.MULTILINE)
573 if not m:
574 raise ValueError('revision and node not found in hg output: %r' % out)
575 rev, node = m.groups()
576 return int(rev), node
573 577
574 def config(self, names=[], untrusted=False, showsource=False): 578 def config(self, names=[], untrusted=False, showsource=False):
575 """Return a list of (section, key, value) config settings from all 579 """Return a list of (section, key, value) config settings from all
576 hgrc files 580 hgrc files
577 581