summaryrefslogtreecommitdiff
path: root/tests/test-keyword.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-keyword.t')
-rw-r--r--tests/test-keyword.t124
1 files changed, 34 insertions, 90 deletions
diff --git a/tests/test-keyword.t b/tests/test-keyword.t
index 56fb4ba..7da72f0 100644
--- a/tests/test-keyword.t
+++ b/tests/test-keyword.t
@@ -9,9 +9,6 @@
> interactive = true
> EOF
-hide outer repo
- $ hg init
-
Run kwdemo before [keyword] files are set up
as it would succeed without uisetup otherwise
@@ -163,31 +160,13 @@ hg cat files and symlink, no expansion
ignore $Id$
a
+Test hook execution
+
$ diff a hooktest
$ cp $HGRCPATH.nohooks $HGRCPATH
$ rm hooktest
-hg status of kw-ignored binary file starting with '\1\n'
-
- >>> open("i", "wb").write("\1\nfoo")
- $ hg -q commit -Am metasep i
- $ hg status
- >>> open("i", "wb").write("\1\nbar")
- $ hg status
- M i
- $ hg -q commit -m "modify metasep" i
- $ hg status --rev 2:3
- M i
- $ touch empty
- $ hg -q commit -A -m "another file"
- $ hg status -A --rev 3:4 i
- C i
-
- $ hg -q strip -n 2
-
-Test hook execution
-
bundle
$ hg bundle --base null ../kw.hg
@@ -229,7 +208,7 @@ Pull from bundle and trigger notify
Message-Id: <hg.a2392c293916*> (glob)
To: Test
- changeset a2392c293916 in $TESTTMP/Test (glob)
+ changeset a2392c293916 in $TESTTMP/Test
details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
description:
addsym
@@ -252,7 +231,7 @@ Pull from bundle and trigger notify
Message-Id: <hg.ef63ca68695b*> (glob)
To: Test
- changeset ef63ca68695b in $TESTTMP/Test (glob)
+ changeset ef63ca68695b in $TESTTMP/Test
details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
description:
absym
@@ -295,20 +274,16 @@ Check whether expansion is filewise and file mode is preserved
$ echo '$Id$' > c
$ echo 'tests for different changenodes' >> c
-#if unix-permissions
$ chmod 600 c
$ ls -l c | cut -b 1-10
-rw-------
-#endif
commit file c
$ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
adding c
-#if unix-permissions
$ ls -l c | cut -b 1-10
-rw-------
-#endif
force expansion
@@ -332,32 +307,30 @@ record
record chunk
- >>> lines = open('a', 'rb').readlines()
- >>> lines.insert(1, 'foo\n')
- >>> lines.append('bar\n')
- >>> open('a', 'wb').writelines(lines)
- $ hg record -d '10 1' -m rectest a<<EOF
+ $ python -c \
+ > 'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
+ $ hg record -d '1 10' -m rectest a<<EOF
> y
> y
> n
> EOF
diff --git a/a b/a
2 hunks, 2 lines changed
- examine changes to 'a'? [Ynesfdaq?]
+ examine changes to 'a'? [Ynsfdaq?]
@@ -1,3 +1,4 @@
expand $Id$
+foo
do not process $Id:
xxx $
- record change 1/2 to 'a'? [Ynesfdaq?]
+ record change 1/2 to 'a'? [Ynsfdaq?]
@@ -2,2 +3,3 @@
do not process $Id:
xxx $
+bar
- record change 2/2 to 'a'? [Ynesfdaq?]
+ record change 2/2 to 'a'? [Ynsfdaq?]
$ hg identify
- 5f5eb23505c3+ tip
+ d17e03c92c97+ tip
$ hg status
M a
A r
@@ -365,7 +338,7 @@ record chunk
Cat modified file a
$ cat a
- expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
+ expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
foo
do not process $Id:
xxx $
@@ -374,8 +347,8 @@ Cat modified file a
Diff remaining chunk
$ hg diff a
- diff -r 5f5eb23505c3 a
- --- a/a Thu Jan 01 00:00:09 1970 -0000
+ diff -r d17e03c92c97 a
+ --- a/a Wed Dec 31 23:59:51 1969 -0000
+++ b/a * (glob)
@@ -2,3 +2,4 @@
foo
@@ -393,25 +366,25 @@ Record all chunks in file a
- do not use "hg record -m" here!
- $ hg record -l msg -d '11 1' a<<EOF
+ $ hg record -l msg -d '1 11' a<<EOF
> y
> y
> y
> EOF
diff --git a/a b/a
2 hunks, 2 lines changed
- examine changes to 'a'? [Ynesfdaq?]
+ examine changes to 'a'? [Ynsfdaq?]
@@ -1,3 +1,4 @@
expand $Id$
+foo
do not process $Id:
xxx $
- record change 1/2 to 'a'? [Ynesfdaq?]
+ record change 1/2 to 'a'? [Ynsfdaq?]
@@ -2,2 +3,3 @@
do not process $Id:
xxx $
+bar
- record change 2/2 to 'a'? [Ynesfdaq?]
+ record change 2/2 to 'a'? [Ynsfdaq?]
File a should be clean
@@ -421,7 +394,7 @@ File a should be clean
rollback and revert expansion
$ cat a
- expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
+ expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
foo
do not process $Id:
xxx $
@@ -462,14 +435,14 @@ Only z should be overwritten
record added file alone
- $ hg -v record -l msg -d '12 2' r<<EOF
+ $ hg -v record -l msg -d '1 12' r<<EOF
> y
> EOF
diff --git a/r b/r
new file mode 100644
- examine changes to 'r'? [Ynesfdaq?]
+ examine changes to 'r'? [Ynsfdaq?]
r
- committed changeset 3:82a2f715724d
+ committed changeset 3:899491280810
overwriting r expanding keywords
- status call required for dirstate.normallookup() check
$ hg status r
@@ -486,35 +459,20 @@ record added keyword ignored file
$ echo '$Id$' > i
$ hg add i
- $ hg --verbose record -d '13 1' -m recignored<<EOF
+ $ hg --verbose record -d '1 13' -m recignored<<EOF
> y
> EOF
diff --git a/i b/i
new file mode 100644
- examine changes to 'i'? [Ynesfdaq?]
+ examine changes to 'i'? [Ynsfdaq?]
i
- committed changeset 3:9f40ceb5a072
+ committed changeset 3:5f40fe93bbdc
$ cat i
$Id$
$ hg -q rollback
$ hg forget i
$ rm i
-amend
-
- $ echo amend >> a
- $ echo amend >> b
- $ hg -q commit -d '14 1' -m 'prepare amend'
-
- $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
- overwriting a expanding keywords
- $ hg -q id
- 577e60613a88
- $ head -1 a
- expand $Id: a,v 577e60613a88 1970/01/01 00:00:15 test $
-
- $ hg -q strip -n tip
-
Test patch queue repo
$ hg init --mq
@@ -578,7 +536,6 @@ Commit and show expansion in original and copy
$ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
c
c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
- removing unknown node 40a904bbbe4c from 1-phase boundary
overwriting c expanding keywords
committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
$ cat a c
@@ -614,7 +571,6 @@ Copy ignored file to ignored file: no overwriting
cp symlink file; hg cp -A symlink file (part1)
- copied symlink points to kwfile: overwrite
-#if symlink
$ cp sym i
$ ls -l i
-rw-r--r--* (glob)
@@ -627,7 +583,6 @@ cp symlink file; hg cp -A symlink file (part1)
expand $Id$
$ hg forget i
$ rm i
-#endif
Test different options of hg kwfiles
@@ -664,8 +619,6 @@ Status after rollback:
$ hg update --clean
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-#if symlink
-
cp symlink file; hg cp -A symlink file (part2)
- copied symlink points to kw ignored file: do not overwrite
@@ -687,8 +640,6 @@ cp symlink file; hg cp -A symlink file (part2)
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ rm i symignored
-#endif
-
Custom keywordmaps as argument to kwdemo
$ hg --quiet kwdemo "Xinfo = {author}: {desc}"
@@ -749,7 +700,6 @@ Commit with multiline message and custom expansion
$ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
a
- removing unknown node 40a904bbbe4c from 1-phase boundary
overwriting a expanding keywords
committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
$ rm log
@@ -847,7 +797,7 @@ Clone to test incoming
> default = ../Test
> EOF
$ hg incoming
- comparing with $TESTTMP/Test (glob)
+ comparing with $TESTTMP/Test
searching for changes
changeset: 2:bb948857c743
tag: tip
@@ -857,9 +807,8 @@ Clone to test incoming
Imported patch should not be rejected
- >>> import re
- >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
- >>> open('a', 'wb').write(text)
+ $ python -c \
+ > 'import re; s=re.sub("(Id.*)","\\1 rejecttest",open("a").read()); open("a","wb").write(s);'
$ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
a
overwriting a expanding keywords
@@ -876,7 +825,7 @@ Imported patch should not be rejected
ignore $Id$
$ hg rollback
- repository tip rolled back to revision 2 (undo import)
+ repository tip rolled back to revision 2 (undo commit)
working directory now based on revision 2
$ hg update --clean
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -928,7 +877,6 @@ kwexpand nonexistent
nonexistent:* (glob)
-#if serve
hg serve
- expand with hgweb file
- no expansion with hgweb annotate/changeset/filediff
@@ -936,14 +884,14 @@ hg serve
$ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
$ cat hg.pid >> $DAEMON_PIDS
- $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw'
+ $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/file/tip/a/?style=raw'
200 Script output follows
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 $
- $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw'
+ $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/annotate/tip/a/?style=raw'
200 Script output follows
@@ -955,7 +903,7 @@ hg serve
- $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw'
+ $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw'
200 Script output follows
@@ -975,7 +923,7 @@ hg serve
+xxx $
+$Xinfo$
- $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
+ $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
200 Script output follows
@@ -992,7 +940,6 @@ hg serve
$ cat errors.log
-#endif
Prepare merge and resolve tests
@@ -1027,7 +974,7 @@ conflict: keyword should stay outside conflict zone
$ hg merge
merging m
warning: conflicts during merge.
- merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
+ merging m failed!
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
[1]
@@ -1053,7 +1000,6 @@ Test restricted mode with transplant -b
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg branch foo
marked working directory as branch foo
- (branches are permanent and global, did you want a bookmark?)
$ mv a a.bak
$ echo foobranch > a
$ cat a.bak >> a
@@ -1135,5 +1081,3 @@ Now disable keyword expansion
$Xinfo$
ignore $Id$
a
-
- $ cd ..