Mercurial > public > mercurial-scm > hg-stable
diff hgext/mq.py @ 13508:0396ca8015be stable
mq: fix qpush recursion in _findtags when status file is wrong (issue2664)
test from timeless to guard against regressing this
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 28 Feb 2011 17:41:40 -0600 |
parents | 375ba42f3cda |
children | 9510ddf87c43 |
line wrap: on
line diff
--- a/hgext/mq.py Fri Feb 11 13:10:39 2011 +0100 +++ b/hgext/mq.py Mon Feb 28 17:41:40 2011 -0600 @@ -2957,7 +2957,9 @@ mqtags = [(patch.node, patch.name) for patch in q.applied] - if mqtags[-1][0] not in self: + try: + r = self.changelog.rev(mqtags[-1][0]) + except error.RepoLookupError: self.ui.warn(_('mq status file refers to unknown node %s\n') % short(mqtags[-1][0])) return result @@ -2982,12 +2984,13 @@ cl = self.changelog qbasenode = q.applied[0].node - if qbasenode not in self: + try: + qbase = cl.rev(qbasenode) + except error.LookupError: self.ui.warn(_('mq status file refers to unknown node %s\n') % short(qbasenode)) return super(mqrepo, self)._branchtags(partial, lrev) - qbase = cl.rev(qbasenode) start = lrev + 1 if start < qbase: # update the cache (excluding the patches) and save it