##// END OF EJS Templates
mq: fix qpush recursion in _findtags when status file is wrong (issue2664)...
Matt Mackall -
r13508:0396ca80 stable
parent child Browse files
Show More
@@ -2957,7 +2957,9 def reposetup(ui, repo):
2957
2957
2958 mqtags = [(patch.node, patch.name) for patch in q.applied]
2958 mqtags = [(patch.node, patch.name) for patch in q.applied]
2959
2959
2960 if mqtags[-1][0] not in self:
2960 try:
2961 r = self.changelog.rev(mqtags[-1][0])
2962 except error.RepoLookupError:
2961 self.ui.warn(_('mq status file refers to unknown node %s\n')
2963 self.ui.warn(_('mq status file refers to unknown node %s\n')
2962 % short(mqtags[-1][0]))
2964 % short(mqtags[-1][0]))
2963 return result
2965 return result
@@ -2982,12 +2984,13 def reposetup(ui, repo):
2982
2984
2983 cl = self.changelog
2985 cl = self.changelog
2984 qbasenode = q.applied[0].node
2986 qbasenode = q.applied[0].node
2985 if qbasenode not in self:
2987 try:
2988 qbase = cl.rev(qbasenode)
2989 except error.LookupError:
2986 self.ui.warn(_('mq status file refers to unknown node %s\n')
2990 self.ui.warn(_('mq status file refers to unknown node %s\n')
2987 % short(qbasenode))
2991 % short(qbasenode))
2988 return super(mqrepo, self)._branchtags(partial, lrev)
2992 return super(mqrepo, self)._branchtags(partial, lrev)
2989
2993
2990 qbase = cl.rev(qbasenode)
2991 start = lrev + 1
2994 start = lrev + 1
2992 if start < qbase:
2995 if start < qbase:
2993 # update the cache (excluding the patches) and save it
2996 # update the cache (excluding the patches) and save it
@@ -51,6 +51,22 test qpush on empty series
51 summary: add foo
51 summary: add foo
52
52
53
53
54 test corrupt status file
55 $ hg qpush
56 applying patch1
57 now at: patch1
58 $ cp .hg/patches/status .hg/patches/status.orig
59 $ hg qpop
60 popping patch1
61 patch queue now empty
62 $ cp .hg/patches/status.orig .hg/patches/status
63 $ hg qpush
64 mq status file refers to unknown node * (glob)
65 abort: working directory revision is not qtip
66 [255]
67 $ rm .hg/patches/status .hg/patches/status.orig
68
69
54 bar should be gone; other unknown/ignored files should still be around
70 bar should be gone; other unknown/ignored files should still be around
55
71
56 $ hg status -A
72 $ hg status -A
General Comments 0
You need to be logged in to leave comments. Login now