Mercurial > hg-stable
changeset 18507:c795c9f87792 stable
histedit: prevent parent guessed via --outgoing from being a revset (issue3770)
If the binary hash of the parent node guessed via --outgoing happened
to contain a special revset character (":" was specified in the bug),
the revset parser would abort. Hexlifying the node before passing it
to the revsingle call should fix that.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Wed, 30 Jan 2013 10:57:28 -0500 |
parents | ef60083b5536 |
children | 813b7a1f7036 |
files | hgext/histedit.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/histedit.py Wed Jan 30 19:40:07 2013 +0100 +++ b/hgext/histedit.py Wed Jan 30 10:57:28 2013 -0500 @@ -454,8 +454,12 @@ if revs: revs = [repo.lookup(rev) for rev in revs] - parent = discovery.findcommonoutgoing( - repo, other, [], force=opts.get('force')).missing[0:1] + # hexlify nodes from outgoing, because we're going to parse + # parent[0] using revsingle below, and if the binary hash + # contains special revset characters like ":" the revset + # parser can choke. + parent = [node.hex(n) for n in discovery.findcommonoutgoing( + repo, other, [], force=opts.get('force')).missing[0:1]] else: if opts.get('force'): raise util.Abort(_('--force only allowed with --outgoing'))