##// END OF EJS Templates
mq: allow qpop if popped revisions are not working dir parents
Dirkjan Ochtman -
r7621:6d891df4 default
parent child Browse files
Show More
@@ -1011,6 +1011,14 b' class queue:'
1011 1011 if p in rr:
1012 1012 self.ui.warn(_("qpop: forcing dirstate update\n"))
1013 1013 update = True
1014 else:
1015 parents = [p.hex() for p in repo[None].parents()]
1016 needupdate = False
1017 for entry in self.applied[start:]:
1018 if entry.rev in parents:
1019 needupdate = True
1020 break
1021 update = needupdate
1014 1022
1015 1023 if not force and update:
1016 1024 self.check_localchanges(repo)
@@ -1021,7 +1029,13 b' class queue:'
1021 1029 if update:
1022 1030 top = self.check_toppatch(repo)
1023 1031
1024 if repo.changelog.heads(rev) != [revlog.bin(self.applied[-1].rev)]:
1032 try:
1033 heads = repo.changelog.heads(rev)
1034 except revlog.LookupError:
1035 node = short(rev)
1036 raise util.Abort(_('trying to pop unknown node %s') % node)
1037
1038 if heads != [revlog.bin(self.applied[-1].rev)]:
1025 1039 raise util.Abort(_("popping would remove a revision not "
1026 1040 "managed by this patch queue"))
1027 1041
@@ -289,7 +289,7 b' hg qpop'
289 289 hg strip -qn tip
290 290 hg tip 2>&1 | sed -e 's/unknown node .*/unknown node/'
291 291 hg branches 2>&1 | sed -e 's/unknown node .*/unknown node/'
292 hg qpop
292 hg qpop 2>&1 | sed -e 's/unknown node .*/unknown node/'
293 293
294 294 cat >>$HGRCPATH <<EOF
295 295 [diff]
@@ -510,3 +510,8 b' hg qpush -f'
510 510 hg st
511 511 hg diff --config diff.nodates=True
512 512 hg qdiff --config diff.nodates=True
513
514 echo % test popping revisions not in working dir ancestry
515 hg qseries -v
516 hg up qparent
517 hg qpop
@@ -1,7 +1,7 b''
1 1 % try to commit on top of a patch
2 2 abort: cannot commit over an applied mq patch
3 3 % qpop/qrefresh on the wrong revision
4 abort: working directory revision is not qtip
4 abort: popping would remove a revision not managed by this patch queue
5 5 using patch queue:
6 6 abort: popping would remove a revision not managed by this patch queue
7 7 abort: working directory revision is not qtip
@@ -294,7 +294,7 b' summary: a'
294 294
295 295 mq status file refers to unknown node
296 296 default 0:cb9a9f314b8b
297 abort: working directory revision is not qtip
297 abort: trying to pop unknown node
298 298 new file
299 299
300 300 diff --git a/new b/new
@@ -538,3 +538,7 b' diff -r 9ecee4f634e3 hello.txt'
538 538 hello
539 539 +world
540 540 +universe
541 % test popping revisions not in working dir ancestry
542 0 A empty
543 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
544 Patch queue now empty
General Comments 0
You need to be logged in to leave comments. Login now