# HG changeset patch # User Idan Kamara # Date 1451609631 28800 # Node ID 2725547a5f92d61a672420569f7237b81b582fab # Parent ffca01835a7c4b84c494f33af485c9118de7d3d8 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. diff -r ffca01835a7c -r 2725547a5f92 hglib/client.py --- a/hglib/client.py Thu Oct 01 12:38:14 2015 -0500 +++ b/hglib/client.py Thu Dec 31 16:53:51 2015 -0800 @@ -568,8 +568,12 @@ close_branch=closebranch, d=date, u=user, l=logfile, I=include, X=exclude, amend=amend) out = self.rawcommand(args) - rev, node = out.splitlines()[-1].rsplit(b(':')) - return int(rev.split()[-1]), node + m = re.search(b(r'^committed changeset (\d+):([0-9a-f]+)'), out, + re.MULTILINE) + if not m: + raise ValueError('revision and node not found in hg output: %r' % out) + rev, node = m.groups() + return int(rev), node def config(self, names=[], untrusted=False, showsource=False): """Return a list of (section, key, value) config settings from all