##// END OF EJS Templates
identify: add template support...
identify: add template support This is based on a patch proposed last year by Mathias De Maré[1], with a few changes. - Tags and bookmarks are now formatted lists, for more flexible queries. - The templater is populated whether or not [-nibtB] is specified. (Plain output is unchanged.) This seems more consistent with other templated commands. - The 'id' property is a string, instead of a list. - The parents of 'wdir()' have their own list of attributes. I left 'id' as a string because it seems very useful for generating version info. It's also a bit strange because the value and meaning changes depending on whether or not --debug is passed (short vs full hash), whether the revision is a merge or not (one hash or two, separated by a '+'), the working directory or not (node vs p1node), and local or not (remote defaults to tip, and never has '+'). The equivalent string built with {rev} seems much less useful, and I couldn't think of a reasonable name, so I left it out. The discussion seemed to be pointing towards having a list of nodes, with more than one entry for a merge. It seems simpler to give the nodes a name, and use {node} for the actual commit probed, especially now that there is a virtual node for 'wdir()'. Yuya mentioned using fm.nested() in that thread, so I did for the parent nodes. I'm not sure if the plan is to fill in all of the context attributes in these items, or if these nested items should simply be made {p1node} and {p1rev}. I used ':' as the tag separator for consistency with {tags} in the log templater. Likewise, bookmarks are separated by a space for consistency with the corresponding log template. [1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-August/087039.html

File last commit:

r32940:75be1499 default
r33051:15a79ac8 default
Show More
test-mq-missingfiles.t
197 lines | 3.4 KiB | text/troff | Tads3Lexer
/ tests / test-mq-missingfiles.t
Adrian Buehlmann
tests: unify some of test-mq*
r12324
Martin Geisler
tests: added a short description to issue numbers...
r12399 Issue835: qpush fails immediately when patching a missing file, but
remaining added files are still created empty which will trick a
future qrefresh.
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ cat > writelines.py <<EOF
> import sys
> path = sys.argv[1]
> args = sys.argv[2:]
> assert (len(args) % 2) == 0
>
> f = file(path, 'wb')
> for i in xrange(len(args)/2):
> count, s = args[2*i:2*i+2]
> count = int(count)
> s = s.decode('string_escape')
> f.write(s*count)
> f.close()
> EOF
$ echo "[extensions]" >> $HGRCPATH
$ echo "mq=" >> $HGRCPATH
$ hg init normal
$ cd normal
Augie Fackler
cleanup: use $PYTHON to run python in many more tests...
r32940 $ $PYTHON ../writelines.py b 10 'a\n'
Adrian Buehlmann
tests: unify some of test-mq*
r12324 $ hg ci -Am addb
adding b
$ echo a > a
Augie Fackler
cleanup: use $PYTHON to run python in many more tests...
r32940 $ $PYTHON ../writelines.py b 2 'b\n' 10 'a\n' 2 'c\n'
Adrian Buehlmann
tests: unify some of test-mq*
r12324 $ echo c > c
$ hg add a c
$ hg qnew -f changeb
$ hg qpop
popping changeb
patch queue now empty
$ hg rm b
$ hg ci -Am rmb
Push patch with missing target:
$ hg qpush
applying changeb
unable to find 'b' for patching
liscju
import: report directory-relative paths in error messages (issue5224)...
r29900 (use '--prefix' to apply patch relative to the current directory)
Adrian Buehlmann
tests: unify some of test-mq*
r12324 2 out of 2 hunks FAILED -- saving rejects to file b.rej
patch failed, unable to continue (try -v)
Yuya Nishihara
commands: say "working directory" in full spelling
r24365 patch failed, rejects left in working directory
timeless@mozdev.org
mq: consistently use qrefresh
r26780 errors during apply, please fix and qrefresh changeb
Adrian Buehlmann
tests: unify some of test-mq*
r12324 [2]
Display added files:
$ cat a
a
$ cat c
c
Display rejections:
$ cat b.rej
--- b
+++ b
@@ -1,3 +1,5 @@
+b
+b
a
a
a
@@ -8,3 +10,5 @@
a
a
a
+c
+c
Patrick Mezard
patch: keep patching after missing copy source (issue3480)...
r16813 Test missing renamed file
$ hg qpop
popping changeb
patch queue now empty
$ hg up -qC 0
$ echo a > a
$ hg mv b bb
Augie Fackler
cleanup: use $PYTHON to run python in many more tests...
r32940 $ $PYTHON ../writelines.py bb 2 'b\n' 10 'a\n' 2 'c\n'
Patrick Mezard
patch: keep patching after missing copy source (issue3480)...
r16813 $ echo c > c
$ hg add a c
$ hg qnew changebb
$ hg qpop
popping changebb
patch queue now empty
$ hg up -qC 1
$ hg qpush
applying changebb
patching file bb
Hunk #1 FAILED at 0
Hunk #2 FAILED at 7
2 out of 2 hunks FAILED -- saving rejects to file bb.rej
b not tracked!
patch failed, unable to continue (try -v)
Yuya Nishihara
commands: say "working directory" in full spelling
r24365 patch failed, rejects left in working directory
timeless@mozdev.org
mq: consistently use qrefresh
r26780 errors during apply, please fix and qrefresh changebb
Patrick Mezard
patch: keep patching after missing copy source (issue3480)...
r16813 [2]
$ cat a
a
$ cat c
c
$ cat bb.rej
--- bb
+++ bb
@@ -1,3 +1,5 @@
+b
+b
a
a
a
@@ -8,3 +10,5 @@
a
a
a
+c
+c
Adrian Buehlmann
tests: unify some of test-mq*
r12324 $ cd ..
$ echo "[diff]" >> $HGRCPATH
$ echo "git=1" >> $HGRCPATH
$ hg init git
$ cd git
Augie Fackler
cleanup: use $PYTHON to run python in many more tests...
r32940 $ $PYTHON ../writelines.py b 1 '\x00'
Adrian Buehlmann
tests: unify some of test-mq*
r12324 $ hg ci -Am addb
adding b
$ echo a > a
Augie Fackler
cleanup: use $PYTHON to run python in many more tests...
r32940 $ $PYTHON ../writelines.py b 1 '\x01' 1 '\x00'
Adrian Buehlmann
tests: unify some of test-mq*
r12324 $ echo c > c
$ hg add a c
$ hg qnew -f changeb
$ hg qpop
popping changeb
patch queue now empty
$ hg rm b
$ hg ci -Am rmb
Push git patch with missing target:
$ hg qpush
applying changeb
unable to find 'b' for patching
liscju
import: report directory-relative paths in error messages (issue5224)...
r29900 (use '--prefix' to apply patch relative to the current directory)
Adrian Buehlmann
tests: unify some of test-mq*
r12324 1 out of 1 hunks FAILED -- saving rejects to file b.rej
patch failed, unable to continue (try -v)
Yuya Nishihara
commands: say "working directory" in full spelling
r24365 patch failed, rejects left in working directory
timeless@mozdev.org
mq: consistently use qrefresh
r26780 errors during apply, please fix and qrefresh changeb
Adrian Buehlmann
tests: unify some of test-mq*
r12324 [2]
$ hg st
? b.rej
Display added files:
$ cat a
a
$ cat c
c
Display rejections:
$ cat b.rej
--- b
+++ b
GIT binary patch
literal 2
Jc${No0000400IC2
$ cd ..
Test push creating directory during git copy or rename:
$ hg init missingdir
$ cd missingdir
$ echo a > a
$ hg ci -Am adda
adding a
$ mkdir d
$ hg copy a d/a2
$ hg mv a d/a
$ hg qnew -g -f patch
$ hg qpop
popping patch
patch queue now empty
$ hg qpush
applying patch
now at: patch
$ cd ..