##// END OF EJS Templates
log: make --patch --follow work inside a subdirectory...
log: make --patch --follow work inside a subdirectory Previously, the 'patch' code for hg log --patch --follow would try to resolve patterns relative to the repository root rather than the current working directory. Fix that by using match.files instead of pats, as done elsewhere nearby.

File last commit:

r21714:635a8201 default
r21876:584bbfd1 stable
Show More
test-mq-qfold.t
180 lines | 2.9 KiB | text/troff | Tads3Lexer
Adrian Buehlmann
tests: unify some of test-mq*
r12324 $ echo "[extensions]" >> $HGRCPATH
$ echo "mq=" >> $HGRCPATH
$ echo "[mq]" >> $HGRCPATH
$ echo "git=keep" >> $HGRCPATH
$ echo "[diff]" >> $HGRCPATH
$ echo "nodates=1" >> $HGRCPATH
init:
$ hg init repo
$ cd repo
$ echo a > a
$ hg ci -Am adda
adding a
$ echo a >> a
$ hg qnew -f p1
$ echo b >> a
$ hg qnew -f p2
$ echo c >> a
$ hg qnew -f p3
Fold in the middle of the queue:
$ hg qpop p1
popping p3
popping p2
now at: p1
$ hg qdiff
diff -r 07f494440405 a
--- a/a
+++ b/a
@@ -1,1 +1,2 @@
a
+a
$ hg qfold p2
$ grep git .hg/patches/p1 && echo 'git patch found!'
[1]
$ hg qser
p1
p3
$ hg qdiff
diff -r 07f494440405 a
--- a/a
+++ b/a
@@ -1,1 +1,3 @@
a
+a
+b
Fold with local changes:
$ echo d >> a
$ hg qfold p3
abort: local changes found, refresh first
[255]
$ hg diff -c .
Brodie Rao
tests: add glob matching for unified tests...
r12376 diff -r 07f494440405 -r ???????????? a (glob)
Adrian Buehlmann
tests: unify some of test-mq*
r12324 --- a/a
+++ b/a
@@ -1,1 +1,3 @@
a
+a
+b
$ hg revert -a --no-backup
reverting a
Fold git patch into a regular patch, expect git patch:
$ echo a >> a
$ hg qnew -f regular
$ hg cp a aa
$ hg qnew --git -f git
$ hg qpop
popping git
now at: regular
$ hg qfold git
$ cat .hg/patches/regular
# HG changeset patch
Brodie Rao
tests: add glob matching for unified tests...
r12376 # Parent ???????????????????????????????????????? (glob)
Adrian Buehlmann
tests: unify some of test-mq*
r12324
diff --git a/a b/a
--- a/a
+++ b/a
@@ -1,3 +1,4 @@
a
a
b
+a
diff --git a/a b/aa
copy from a
copy to aa
--- a/a
+++ b/aa
@@ -1,3 +1,4 @@
a
a
b
+a
$ hg qpop
popping regular
now at: p1
$ hg qdel regular
Fold regular patch into a git patch, expect git patch:
$ hg cp a aa
$ hg qnew --git -f git
$ echo b >> aa
$ hg qnew -f regular
$ hg qpop
popping regular
now at: git
$ hg qfold regular
$ cat .hg/patches/git
# HG changeset patch
Brodie Rao
tests: add glob matching for unified tests...
r12376 # Parent ???????????????????????????????????????? (glob)
Adrian Buehlmann
tests: unify some of test-mq*
r12324
diff --git a/a b/aa
copy from a
copy to aa
--- a/a
+++ b/aa
@@ -1,3 +1,4 @@
a
a
b
+b
FUJIWARA Katsunori
qfold: save manually edited commit message into ".hg/last-message.txt"...
r20769 Test saving last-message.txt:
$ hg qrefresh -m "original message"
Sean Farley
tests: use TESTTMP instead of TESTDIR...
r20859 $ cat > $TESTTMP/commitfailure.py <<EOF
FUJIWARA Katsunori
qfold: save manually edited commit message into ".hg/last-message.txt"...
r20769 > from mercurial import util
> def reposetup(ui, repo):
> class commitfailure(repo.__class__):
> def commit(self, *args, **kwargs):
> raise util.Abort('emulating unexpected abort')
> repo.__class__ = commitfailure
> EOF
$ cat > .hg/hgrc <<EOF
> [extensions]
Sean Farley
tests: use TESTTMP instead of TESTDIR...
r20859 > commitfailure = $TESTTMP/commitfailure.py
FUJIWARA Katsunori
qfold: save manually edited commit message into ".hg/last-message.txt"...
r20769 > EOF
Sean Farley
tests: use TESTTMP instead of TESTDIR...
r20859 $ cat > $TESTTMP/editor.sh << EOF
FUJIWARA Katsunori
qfold: save manually edited commit message into ".hg/last-message.txt"...
r20769 > echo "==== before editing"
> cat \$1
> echo "===="
> (echo; echo "test saving last-message.txt") >> \$1
> EOF
$ rm -f .hg/last-message.txt
Sean Farley
tests: use TESTTMP instead of TESTDIR...
r20859 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qfold -e p3
FUJIWARA Katsunori
qfold: save manually edited commit message into ".hg/last-message.txt"...
r20769 ==== before editing
original message====
refresh interrupted while patch was popped! (revert --all, qpush to recover)
abort: emulating unexpected abort
[255]
$ cat .hg/last-message.txt
original message
test saving last-message.txt
Adrian Buehlmann
tests: unify some of test-mq*
r12324 $ cd ..