##// 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:

r31056:37ab9e20 default
r33051:15a79ac8 default
Show More
test-histedit-bookmark-motion.t
186 lines | 5.3 KiB | text/troff | Tads3Lexer
/ tests / test-histedit-bookmark-motion.t
Augie Fackler
histedit: new extension for interactive history editing
r17064 $ . "$TESTDIR/histedit-helpers.sh"
Augie Fackler
histedit tests: fix check-code problems
r17065 $ cat >> $HGRCPATH <<EOF
Augie Fackler
histedit: new extension for interactive history editing
r17064 > [extensions]
> histedit=
> EOF
$ hg init r
$ cd r
Augie Fackler
histedit tests: fix check-code problems
r17065
Augie Fackler
histedit: new extension for interactive history editing
r17064 $ for x in a b c d e f ; do
> echo $x > $x
> hg add $x
> hg ci -m $x
> done
$ hg book -r 1 will-move-backwards
$ hg book -r 2 two
$ hg book -r 2 also-two
$ hg book -r 3 three
$ hg book -r 4 four
$ hg book -r tip five
$ hg log --graph
@ changeset: 5:652413bf663e
| bookmark: five
| tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: f
|
o changeset: 4:e860deea161a
| bookmark: four
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: e
|
o changeset: 3:055a42cdd887
| bookmark: three
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: d
|
o changeset: 2:177f92b77385
| bookmark: also-two
| bookmark: two
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: c
|
o changeset: 1:d2ae7f538514
| bookmark: will-move-backwards
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: b
|
o changeset: 0:cb9a9f314b8b
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
$ HGEDITOR=cat hg histedit 1
pick d2ae7f538514 1 b
pick 177f92b77385 2 c
pick 055a42cdd887 3 d
pick e860deea161a 4 e
pick 652413bf663e 5 f
# Edit history between d2ae7f538514 and 652413bf663e
#
Adrian Zgorzałek
histedit: clarify description of fold command...
r20503 # Commits are listed from least to most recent
#
liscju
histedit: adds hint how to reorder changesets at editor (issue3766)
r28396 # You can reorder changesets by reordering the lines
#
Augie Fackler
histedit: new extension for interactive history editing
r17064 # Commands:
timeless
histedit: prefer edit commit, edit message, use commit...
r27674 #
# e, edit = use commit, but stop for amending
# m, mess = edit commit message without changing commit content
Augie Fackler
histedit: new extension for interactive history editing
r17064 # p, pick = use commit
timeless
histedit: prefer edit commit, edit message, use commit...
r27674 # d, drop = remove commit from history
Matt Mackall
histedit: shorten new fold message...
r20511 # f, fold = use commit, but combine it with the one above
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 # r, roll = like fold, but discard this commit's description and date
Augie Fackler
histedit: new extension for interactive history editing
r17064 #
Pierre-Yves David
histedit-test: generalise --commands "-" usage...
r19019 $ hg histedit 1 --commands - --verbose << EOF | grep histedit
Augie Fackler
histedit: new extension for interactive history editing
r17064 > pick 177f92b77385 2 c
> drop d2ae7f538514 1 b
> pick 055a42cdd887 3 d
> fold e860deea161a 4 e
> pick 652413bf663e 5 f
> EOF
Durham Goode
histedit: make histedit prune when obsolete is enabled...
r26763 saved backup bundle to $TESTTMP/r/.hg/strip-backup/96e494a2d553-3c6c5d92-backup.hg (glob)
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 histedit: moving bookmarks also-two from 177f92b77385 to b346ab9a313d
histedit: moving bookmarks five from 652413bf663e to cacdfd884a93
histedit: moving bookmarks four from e860deea161a to 59d9f330561f
histedit: moving bookmarks three from 055a42cdd887 to 59d9f330561f
histedit: moving bookmarks two from 177f92b77385 to b346ab9a313d
Pierre-Yves David
histedit: replace various nodes lists with replacement graph (and issue3582)...
r17758 histedit: moving bookmarks will-move-backwards from d2ae7f538514 to cb9a9f314b8b
Durham Goode
bundles: do not overwrite existing backup bundles (BC)...
r23835 saved backup bundle to $TESTTMP/r/.hg/strip-backup/d2ae7f538514-48787b8d-backup.hg (glob)
Augie Fackler
histedit: new extension for interactive history editing
r17064 $ hg log --graph
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 @ changeset: 3:cacdfd884a93
Augie Fackler
histedit: new extension for interactive history editing
r17064 | bookmark: five
| tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: f
|
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 o changeset: 2:59d9f330561f
Augie Fackler
histedit: new extension for interactive history editing
r17064 | bookmark: four
| bookmark: three
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: d
|
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 o changeset: 1:b346ab9a313d
Augie Fackler
histedit: new extension for interactive history editing
r17064 | bookmark: also-two
| bookmark: two
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: c
|
o changeset: 0:cb9a9f314b8b
bookmark: will-move-backwards
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
$ HGEDITOR=cat hg histedit 1
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 pick b346ab9a313d 1 c
pick 59d9f330561f 2 d
pick cacdfd884a93 3 f
Augie Fackler
histedit: new extension for interactive history editing
r17064
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 # Edit history between b346ab9a313d and cacdfd884a93
Augie Fackler
histedit: new extension for interactive history editing
r17064 #
Adrian Zgorzałek
histedit: clarify description of fold command...
r20503 # Commits are listed from least to most recent
#
liscju
histedit: adds hint how to reorder changesets at editor (issue3766)
r28396 # You can reorder changesets by reordering the lines
#
Augie Fackler
histedit: new extension for interactive history editing
r17064 # Commands:
timeless
histedit: prefer edit commit, edit message, use commit...
r27674 #
# e, edit = use commit, but stop for amending
# m, mess = edit commit message without changing commit content
Augie Fackler
histedit: new extension for interactive history editing
r17064 # p, pick = use commit
timeless
histedit: prefer edit commit, edit message, use commit...
r27674 # d, drop = remove commit from history
Matt Mackall
histedit: shorten new fold message...
r20511 # f, fold = use commit, but combine it with the one above
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 # r, roll = like fold, but discard this commit's description and date
Augie Fackler
histedit: new extension for interactive history editing
r17064 #
Pierre-Yves David
histedit-test: generalise --commands "-" usage...
r19019 $ hg histedit 1 --commands - --verbose << EOF | grep histedit
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 > pick b346ab9a313d 1 c
> pick cacdfd884a93 3 f
> pick 59d9f330561f 2 d
Augie Fackler
histedit: new extension for interactive history editing
r17064 > EOF
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 histedit: moving bookmarks five from cacdfd884a93 to c04e50810e4b
histedit: moving bookmarks four from 59d9f330561f to c04e50810e4b
histedit: moving bookmarks three from 59d9f330561f to c04e50810e4b
Durham Goode
bundles: do not overwrite existing backup bundles (BC)...
r23835 saved backup bundle to $TESTTMP/r/.hg/strip-backup/59d9f330561f-073008af-backup.hg (glob)
Augie Fackler
histedit: new extension for interactive history editing
r17064
We expect 'five' to stay at tip, since the tipmost bookmark is most
likely the useful signal.
$ hg log --graph
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 @ changeset: 3:c04e50810e4b
Augie Fackler
histedit: new extension for interactive history editing
r17064 | bookmark: five
| bookmark: four
| bookmark: three
| tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: d
|
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 o changeset: 2:c13eb81022ca
Augie Fackler
histedit: new extension for interactive history editing
r17064 | user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: f
|
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 o changeset: 1:b346ab9a313d
Augie Fackler
histedit: new extension for interactive history editing
r17064 | bookmark: also-two
| bookmark: two
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: c
|
o changeset: 0:cb9a9f314b8b
bookmark: will-move-backwards
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a