test-keyword.out
496 lines
| 11.5 KiB
| text/plain
|
TextLexer
/ tests / test-keyword.out
Christian Ebert
|
r5816 | % help | ||
keyword extension - keyword expansion in local repositories | ||||
This extension expands RCS/CVS-like or self-customized $Keywords$ | ||||
in tracked text files selected by your configuration. | ||||
Keywords are only expanded in local repositories and not stored in | ||||
the change history. The mechanism can be regarded as a convenience | ||||
for the current user or for archive distribution. | ||||
Configuration is done in the [keyword] and [keywordmaps] sections | ||||
of hgrc files. | ||||
Example: | ||||
[keyword] | ||||
# expand keywords in every python file except those matching "x*" | ||||
**.py = | ||||
x* = ignore | ||||
Note: the more specific you are in your filename patterns | ||||
the less you lose speed in huge repos. | ||||
For [keywordmaps] template mapping and expansion demonstration and | ||||
control run "hg kwdemo". | ||||
An additional date template filter {date|utcdate} is provided. | ||||
The default template mappings (view with "hg kwdemo -d") can be replaced | ||||
with customized keywords and templates. | ||||
Again, run "hg kwdemo" to control the results of your config changes. | ||||
Before changing/disabling active keywords, run "hg kwshrink" to avoid | ||||
the risk of inadvertedly storing expanded keywords in the change history. | ||||
To force expansion after enabling it, or a configuration change, run | ||||
"hg kwexpand". | ||||
Christian Ebert
|
r5884 | Also, when committing with the record extension or using mq's qrecord, be aware | ||
that keywords cannot be updated. Again, run "hg kwexpand" on the files in | ||||
question to update keyword expansions after all changes have been checked in. | ||||
Christian Ebert
|
r5816 | Expansions spanning more than one line and incremental expansions, | ||
like CVS' $Log$, are not supported. A keyword template map | ||||
"Log = {desc}" expands to the first line of the changeset description. | ||||
list of commands: | ||||
kwdemo print [keywordmaps] configuration and an expansion example | ||||
kwexpand expand keywords in working directory | ||||
kwfiles print files currently configured for keyword expansion | ||||
kwshrink revert expanded keywords in working directory | ||||
use "hg -v help keyword" to show aliases and global options | ||||
% hg kwdemo | ||||
[extensions] | ||||
hgext.keyword = | ||||
[keyword] | ||||
* = | ||||
b = ignore | ||||
demo.txt = | ||||
[keywordmaps] | ||||
RCSFile = {file|basename},v | ||||
Author = {author|user} | ||||
Header = {root}/{file},v {node|short} {date|utcdate} {author|user} | ||||
Source = {root}/{file},v | ||||
Date = {date|utcdate} | ||||
Id = {file|basename},v {node|short} {date|utcdate} {author|user} | ||||
Revision = {node|short} | ||||
$RCSFile: demo.txt,v $ | ||||
$Author: test $ | ||||
$Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ | ||||
$Source: /TMP/demo.txt,v $ | ||||
$Date: 2000/00/00 00:00:00 $ | ||||
$Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ | ||||
$Revision: xxxxxxxxxxxx $ | ||||
[extensions] | ||||
hgext.keyword = | ||||
[keyword] | ||||
* = | ||||
b = ignore | ||||
demo.txt = | ||||
[keywordmaps] | ||||
Branch = {branches} | ||||
$Branch: demobranch $ | ||||
% kwshrink should exit silently in empty/invalid repo | ||||
Patrick Mezard
|
r6061 | pulling from test-keyword.hg | ||
requesting all changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
added 1 changesets with 1 changes to 1 files | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
Christian Ebert
|
r5816 | % cat | ||
expand $Id$ | ||||
do not process $Id: | ||||
xxx $ | ||||
ignore $Id$ | ||||
% addremove | ||||
adding a | ||||
adding b | ||||
% status | ||||
A a | ||||
A b | ||||
% default keyword expansion including commit hook | ||||
% interrupted commit should not change state or run commit hook | ||||
a | ||||
b | ||||
transaction abort! | ||||
rollback completed | ||||
Thomas Arendsen Hein
|
r5855 | abort: empty commit message | ||
Christian Ebert
|
r5816 | % status | ||
A a | ||||
A b | ||||
% commit | ||||
a | ||||
b | ||||
overwriting a expanding keywords | ||||
running hook commit.test: cp a hooktest | ||||
Gilles Moris
|
r6935 | committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9 | ||
Christian Ebert
|
r5816 | % status | ||
? hooktest | ||||
% identify | ||||
Patrick Mezard
|
r6061 | ef63ca68695b | ||
Christian Ebert
|
r5816 | % cat | ||
Patrick Mezard
|
r6061 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
ignore $Id$ | ||||
% hg cat | ||||
Patrick Mezard
|
r6061 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
ignore $Id$ | ||||
a | ||||
% diff a hooktest | ||||
% removing commit hook from config | ||||
Christian Ebert
|
r6051 | % bundle | ||
Patrick Mezard
|
r6061 | 2 changesets found | ||
Christian Ebert
|
r6116 | % notify on pull to check whether keywords stay as is in email | ||
% ie. if patch.diff wrapper acts as it should | ||||
Christian Ebert
|
r6051 | % pull from bundle | ||
pulling from ../kw.hg | ||||
requesting all changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
Patrick Mezard
|
r6061 | added 2 changesets with 3 changes to 3 files | ||
Christian Ebert
|
r6116 | |||
diff -r 000000000000 -r a2392c293916 sym | ||||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 | ||||
+++ b/sym Sat Feb 09 20:25:47 2008 +0100 | ||||
@@ -0,0 +1,1 @@ | ||||
+a | ||||
\ No newline at end of file | ||||
diff -r a2392c293916 -r ef63ca68695b a | ||||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 | ||||
+++ b/a Thu Jan 01 00:00:00 1970 +0000 | ||||
@@ -0,0 +1,3 @@ | ||||
+expand $Id$ | ||||
+do not process $Id: | ||||
+xxx $ | ||||
diff -r a2392c293916 -r ef63ca68695b b | ||||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 | ||||
+++ b/b Thu Jan 01 00:00:00 1970 +0000 | ||||
@@ -0,0 +1,1 @@ | ||||
+ignore $Id$ | ||||
Christian Ebert
|
r6051 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
Christian Ebert
|
r6116 | % remove notify config | ||
Christian Ebert
|
r5816 | % touch | ||
% status | ||||
% update | ||||
3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
% cat | ||||
Patrick Mezard
|
r6061 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
ignore $Id$ | ||||
Christian Ebert
|
r5856 | % check whether expansion is filewise | ||
% commit c | ||||
adding c | ||||
% force expansion | ||||
overwriting a expanding keywords | ||||
overwriting c expanding keywords | ||||
% compare changenodes in a c | ||||
Patrick Mezard
|
r6061 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | ||
Christian Ebert
|
r5856 | do not process $Id: | ||
xxx $ | ||||
Patrick Mezard
|
r6061 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ | ||
Christian Ebert
|
r5856 | tests for different changenodes | ||
Christian Ebert
|
r6051 | % qinit -c | ||
Christian Ebert
|
r5894 | % qimport | ||
Christian Ebert
|
r6051 | % qcommit | ||
Christian Ebert
|
r5894 | % keywords should not be expanded in patch | ||
# HG changeset patch | ||||
# User User Name <user@example.com> | ||||
# Date 1 0 | ||||
Patrick Mezard
|
r6061 | # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad | ||
# Parent ef63ca68695bc9495032c6fda1350c71e6d256e9 | ||||
Christian Ebert
|
r5894 | cndiff | ||
Patrick Mezard
|
r6061 | diff -r ef63ca68695b -r 40a904bbbe4c c | ||
Christian Ebert
|
r5894 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | ||
+++ b/c Thu Jan 01 00:00:01 1970 +0000 | ||||
@@ -0,0 +1,2 @@ | ||||
+$Id$ | ||||
+tests for different changenodes | ||||
% qpop | ||||
Patch queue now empty | ||||
% qgoto - should imply qpush | ||||
applying mqtest.diff | ||||
Now at: mqtest.diff | ||||
% cat | ||||
Patrick Mezard
|
r6061 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ | ||
Christian Ebert
|
r5894 | tests for different changenodes | ||
% qpop and move on | ||||
Patch queue now empty | ||||
Christian Ebert
|
r5816 | % copy | ||
% kwfiles added | ||||
a | ||||
c | ||||
% commit | ||||
c | ||||
c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 | ||||
overwriting c expanding keywords | ||||
Gilles Moris
|
r6935 | committed changeset 2:e22d299ac0c2bd8897b3df5114374b9e4d4ca62f | ||
Christian Ebert
|
r5816 | % cat a c | ||
Patrick Mezard
|
r6061 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
Patrick Mezard
|
r6061 | expand $Id: c,v e22d299ac0c2 1970/01/01 00:00:01 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
Matt Mackall
|
r6328 | % touch copied c | ||
Christian Ebert
|
r5816 | % status | ||
% kwfiles | ||||
a | ||||
c | ||||
% diff --rev | ||||
Patrick Mezard
|
r6061 | diff -r ef63ca68695b c | ||
Christian Ebert
|
r5816 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | ||
@@ -0,0 +1,3 @@ | ||||
Christian Ebert
|
r5885 | +expand $Id$ | ||
Christian Ebert
|
r5816 | +do not process $Id: | ||
+xxx $ | ||||
% rollback | ||||
rolling back last transaction | ||||
% status | ||||
A c | ||||
% update -C | ||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
% custom keyword expansion | ||||
% try with kwdemo | ||||
[extensions] | ||||
hgext.keyword = | ||||
[keyword] | ||||
* = | ||||
b = ignore | ||||
demo.txt = | ||||
[keywordmaps] | ||||
Xinfo = {author}: {desc} | ||||
$Xinfo: test: hg keyword config and expansion example $ | ||||
% cat | ||||
Patrick Mezard
|
r6061 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
ignore $Id$ | ||||
% hg cat | ||||
Patrick Mezard
|
r6061 | expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
ignore $Id$ | ||||
a | ||||
% interrupted commit should not change state | ||||
transaction abort! | ||||
rollback completed | ||||
Thomas Arendsen Hein
|
r5855 | abort: empty commit message | ||
Christian Ebert
|
r5816 | % status | ||
M a | ||||
? log | ||||
% commit | ||||
a | ||||
overwriting a expanding keywords | ||||
Gilles Moris
|
r6935 | committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83 | ||
Christian Ebert
|
r5816 | % status | ||
Christian Ebert
|
r6867 | % verify | ||
checking changesets | ||||
checking manifests | ||||
crosschecking files in changesets and manifests | ||||
checking files | ||||
3 files, 3 changesets, 4 total revisions | ||||
Christian Ebert
|
r5816 | % cat | ||
Patrick Mezard
|
r6061 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
$Xinfo: User Name <user@example.com>: firstline $ | ||||
ignore $Id$ | ||||
% hg cat | ||||
Patrick Mezard
|
r6061 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
$Xinfo: User Name <user@example.com>: firstline $ | ||||
ignore $Id$ | ||||
a | ||||
Christian Ebert
|
r6667 | % annotate | ||
1: expand $Id$ | ||||
1: do not process $Id: | ||||
1: xxx $ | ||||
2: $Xinfo$ | ||||
Christian Ebert
|
r5816 | % remove | ||
Gilles Moris
|
r6935 | committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012 | ||
Christian Ebert
|
r5816 | % status | ||
% rollback | ||||
rolling back last transaction | ||||
% status | ||||
R a | ||||
% revert a | ||||
% cat a | ||||
Patrick Mezard
|
r6061 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
$Xinfo: User Name <user@example.com>: firstline $ | ||||
% clone to test incoming | ||||
requesting all changes | ||||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
Patrick Mezard
|
r6061 | added 2 changesets with 3 changes to 3 files | ||
Adrian Buehlmann
|
r6338 | updating working directory | ||
Christian Ebert
|
r5816 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
% incoming | ||||
Jesse Glick
|
r5943 | comparing with test-keyword/Test | ||
Christian Ebert
|
r5816 | searching for changes | ||
Patrick Mezard
|
r6061 | changeset: 2:bb948857c743 | ||
Christian Ebert
|
r5816 | tag: tip | ||
user: User Name <user@example.com> | ||||
date: Thu Jan 01 00:00:02 1970 +0000 | ||||
summary: firstline | ||||
% commit rejecttest | ||||
a | ||||
overwriting a expanding keywords | ||||
Gilles Moris
|
r6935 | committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082 | ||
Christian Ebert
|
r5816 | % export | ||
% import | ||||
applying ../rejecttest.diff | ||||
% cat | ||||
Patrick Mezard
|
r6061 | expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest | ||
Christian Ebert
|
r5816 | do not process $Id: rejecttest | ||
xxx $ | ||||
$Xinfo: User Name <user@example.com>: rejects? $ | ||||
ignore $Id$ | ||||
% rollback | ||||
rolling back last transaction | ||||
% clean update | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
% kwexpand/kwshrink on selected files | ||||
% copy a x/a | ||||
% kwexpand a | ||||
overwriting a expanding keywords | ||||
% kwexpand x/a should abort | ||||
Christian Ebert
|
r6672 | abort: outstanding uncommitted changes | ||
Christian Ebert
|
r5816 | x/a | ||
x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e | ||||
overwriting x/a expanding keywords | ||||
Gilles Moris
|
r6935 | committed changeset 3:cfa68229c1167443337266ebac453c73b1d5d16e | ||
Christian Ebert
|
r5816 | % cat a | ||
Patrick Mezard
|
r6061 | expand $Id: x/a cfa68229c116 Thu, 01 Jan 1970 00:00:03 +0000 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
$Xinfo: User Name <user@example.com>: xa $ | ||||
% kwshrink a inside directory x | ||||
overwriting x/a shrinking keywords | ||||
% cat a | ||||
expand $Id$ | ||||
do not process $Id: | ||||
xxx $ | ||||
$Xinfo$ | ||||
% kwexpand nonexistent | ||||
Patrick Mezard
|
r6061 | nonexistent: | ||
Christian Ebert
|
r6927 | % hg serve | ||
% expansion | ||||
% hgweb file | ||||
200 Script output follows | ||||
Patrick Mezard
|
r6061 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | ||
Christian Ebert
|
r5816 | do not process $Id: | ||
xxx $ | ||||
$Xinfo: User Name <user@example.com>: firstline $ | ||||
Christian Ebert
|
r6927 | % no expansion | ||
% hgweb annotate | ||||
200 Script output follows | ||||
Benoit Boissinot
|
r6968 | user@1: expand $Id$ | ||
user@1: do not process $Id: | ||||
user@1: xxx $ | ||||
user@2: $Xinfo$ | ||||
Christian Ebert
|
r6927 | |||
Dirkjan Ochtman
|
r6354 | % hgweb changeset | ||
200 Script output follows | ||||
# HG changeset patch | ||||
# User User Name <user@example.com> | ||||
# Date 3 0 | ||||
# Node ID cfa68229c1167443337266ebac453c73b1d5d16e | ||||
# Parent bb948857c743469b22bbf51f7ec8112279ca5d83 | ||||
xa | ||||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 | ||||
+++ b/x/a Thu Jan 01 00:00:03 1970 +0000 | ||||
@@ -0,0 +1,4 @@ | ||||
+expand $Id$ | ||||
+do not process $Id: | ||||
+xxx $ | ||||
+$Xinfo$ | ||||
% hgweb filediff | ||||
200 Script output follows | ||||
--- a/a Thu Jan 01 00:00:00 1970 +0000 | ||||
+++ b/a Thu Jan 01 00:00:02 1970 +0000 | ||||
@@ -1,3 +1,4 @@ | ||||
expand $Id$ | ||||
do not process $Id: | ||||
xxx $ | ||||
+$Xinfo$ | ||||
% errors encountered | ||||
Christian Ebert
|
r6933 | % merge/resolve | ||
% simplemerge | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
created new head | ||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$Id: m 8731e1dadc99 Thu, 01 Jan 1970 00:00:00 +0000 test $ | ||||
foo | ||||
% conflict | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
created new head | ||||
merging m | ||||
warning: conflicts during merge. | ||||
merging m failed! | ||||
0 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||||
use 'hg resolve' to retry unresolved file merges | ||||
% keyword stays outside conflict zone | ||||
$Id$ | ||||
<<<<<<< local | ||||
bar | ||||
======= | ||||
foo | ||||
>>>>>>> other | ||||
% resolve to local | ||||
$Id: m 43dfd2854b5b Thu, 01 Jan 1970 00:00:00 +0000 test $ | ||||
bar | ||||
Christian Ebert
|
r6927 | % switch off expansion | ||
% kwshrink with unknown file u | ||||
overwriting a shrinking keywords | ||||
Christian Ebert
|
r6933 | overwriting m shrinking keywords | ||
Christian Ebert
|
r6927 | overwriting x/a shrinking keywords | ||
% cat | ||||
expand $Id$ | ||||
do not process $Id: | ||||
xxx $ | ||||
$Xinfo$ | ||||
ignore $Id$ | ||||
% hg cat | ||||
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | ||||
do not process $Id: | ||||
xxx $ | ||||
$Xinfo: User Name <user@example.com>: firstline $ | ||||
ignore $Id$ | ||||
a | ||||
% cat | ||||
expand $Id$ | ||||
do not process $Id: | ||||
xxx $ | ||||
$Xinfo$ | ||||
ignore $Id$ | ||||
% hg cat | ||||
expand $Id$ | ||||
do not process $Id: | ||||
xxx $ | ||||
$Xinfo$ | ||||
ignore $Id$ | ||||
a | ||||