##// END OF EJS Templates
phabricator: warn if unable to amend, instead of aborting after posting...
phabricator: warn if unable to amend, instead of aborting after posting There was a divergence in behavior here between obsolete and strip based amending. I first noticed the abort when testing outside of the test harness, but then had trouble recreating it here after reverting the code changes. It turns out, strip based amend was successfully amending the public commit after it was posted! It looks like the protection is in the `commit --amend` command, not in the underlying code that it calls. I considered doing a preflight check and aborting. But the locks are only acquired at the end, if amending, and this is too large a section of code to be wrapped in a maybe-it's-held-or-not context manager for my tastes. Additionally, some people do post-push reviews, and amending is the default behavior, so they shouldn't see a misleading error message. The lack of a 'Differential Revision' entry in the commit message breaks a {phabreview} test, so it had to be partially conditionalized.

File last commit:

r26736:143b52fc default
r41198:0101a35d default
Show More
test-mq-qdelete.t
197 lines | 3.5 KiB | text/troff | Tads3Lexer
/ tests / test-mq-qdelete.t
Adrian Buehlmann
tests: unify some of test-mq*
r12324 $ echo "[extensions]" >> $HGRCPATH
$ echo "mq=" >> $HGRCPATH
$ hg init a
$ cd a
$ echo 'base' > base
$ hg ci -Ambase -d '1 0'
adding base
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qnew -d '1 0' pa
$ hg qnew -d '1 0' pb
$ hg qnew -d '1 0' pc
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qdel
abort: qdelete requires at least one revision or patch name
[255]
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qdel pc
abort: cannot delete applied patch pc
Adrian Buehlmann
tests: unify some of test-mq*
r12324 [255]
$ hg qpop
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 popping pc
now at: pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324
Dan Villiom Podlaski Christiansen
mq: handle deleting the same patch twice in one command (issue2427)
r12655 Delete the same patch twice in one command (issue2427)
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qdel pc pc
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qseries
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 pa
pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ ls .hg/patches
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 pa
pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324 series
status
$ hg qpop
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 popping pb
now at: pa
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qdel -k 1
$ ls .hg/patches
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 pa
pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324 series
status
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qdel -r pa
patch pa finalized without changeset message
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qapplied
$ hg log --template '{rev} {desc}\n'
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 1 [mq]: pa
Adrian Buehlmann
tests: unify some of test-mq*
r12324 0 base
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qnew pd
$ hg qnew pe
$ hg qnew pf
Adrian Buehlmann
tests: unify some of test-mq*
r12324
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qdel -r pe
Adrian Buehlmann
tests: unify some of test-mq*
r12324 abort: cannot delete revision 3 above applied patches
[255]
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qdel -r qbase:pe
patch pd finalized without changeset message
patch pe finalized without changeset message
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qapplied
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 pf
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg log --template '{rev} {desc}\n'
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 4 [mq]: pf
3 [mq]: pe
2 [mq]: pd
1 [mq]: pa
Adrian Buehlmann
tests: unify some of test-mq*
r12324 0 base
$ cd ..
$ hg init b
$ cd b
$ echo 'base' > base
$ hg ci -Ambase -d '1 0'
adding base
$ hg qfinish
abort: no revisions specified
[255]
$ hg qfinish -a
no patches applied
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qnew -d '1 0' pa
$ hg qnew -d '1 0' pb
$ hg qnew pc # XXX fails to apply by /usr/bin/patch if we put a date
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qfinish 0
abort: revision 0 is not managed
[255]
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qfinish pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324 abort: cannot delete revision 2 above applied patches
[255]
$ hg qpop
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 popping pc
now at: pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qfinish -a pc
abort: unknown revision 'pc'!
Adrian Buehlmann
tests: unify some of test-mq*
r12324 [255]
$ hg qpush
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 applying pc
patch pc is empty
now at: pc
Adrian Buehlmann
tests: unify some of test-mq*
r12324
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qfinish qbase:pb
patch pa finalized without changeset message
patch pb finalized without changeset message
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qapplied
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 pc
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg log --template '{rev} {desc}\n'
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 3 imported patch pc
2 [mq]: pb
1 [mq]: pa
Adrian Buehlmann
tests: unify some of test-mq*
r12324 0 base
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qfinish -a pc
patch pc finalized without changeset message
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qapplied
$ hg log --template '{rev} {desc}\n'
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 3 imported patch pc
2 [mq]: pb
1 [mq]: pa
Adrian Buehlmann
tests: unify some of test-mq*
r12324 0 base
$ ls .hg/patches
series
status
Dan Villiom Podlaski Christiansen
mq: silence spurious output....
r12658 qdel -k X && hg qimp -e X used to trigger spurious output with versioned queues
$ hg init --mq
$ hg qimport -r 3
$ hg qpop
Mads Kiilerich
mq: generate patch names from first line of description...
r26736 popping imported_patch_pc
Dan Villiom Podlaski Christiansen
mq: silence spurious output....
r12658 patch queue now empty
Mads Kiilerich
mq: generate patch names from first line of description...
r26736 $ hg qdel -k imported_patch_pc
$ hg qimp -e imported_patch_pc
adding imported_patch_pc to series file
Dan Villiom Podlaski Christiansen
mq: silence spurious output....
r12658 $ hg qfinish -a
no patches applied
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010
resilience to inconsistency: qfinish -a with applied patches not in series
$ hg qser
Mads Kiilerich
mq: generate patch names from first line of description...
r26736 imported_patch_pc
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010 $ hg qapplied
$ hg qpush
Mads Kiilerich
mq: generate patch names from first line of description...
r26736 applying imported_patch_pc
patch imported_patch_pc is empty
now at: imported_patch_pc
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010 $ echo next >> base
$ hg qrefresh -d '1 0'
$ echo > .hg/patches/series # remove 3.diff from series to confuse mq
$ hg qfinish -a
Mads Kiilerich
mq: generate patch names from first line of description...
r26736 revision 47dfa8501675 refers to unknown patches: imported_patch_pc
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010
more complex state 'both known and unknown patches
$ echo hip >> base
$ hg qnew -f -d '1 0' -m 4 4.diff
$ echo hop >> base
$ hg qnew -f -d '1 0' -m 5 5.diff
$ echo > .hg/patches/series # remove 4.diff and 5.diff from series to confuse mq
$ echo hup >> base
$ hg qnew -f -d '1 0' -m 6 6.diff
Matt Mackall
mq: add a warning about uncommitted changes for qfinish
r15476 $ echo pup > base
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010 $ hg qfinish -a
Matt Mackall
mq: add a warning about uncommitted changes for qfinish
r15476 warning: uncommitted changes in the working directory
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 revision 2b1c98802260 refers to unknown patches: 5.diff
revision 33a6861311c0 refers to unknown patches: 4.diff
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913 $ cd ..