summaryrefslogtreecommitdiff
path: root/tests/test-log.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-log.t')
-rw-r--r--tests/test-log.t221
1 files changed, 82 insertions, 139 deletions
diff --git a/tests/test-log.t b/tests/test-log.t
index 0a4248e..f85387c 100644
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -1,26 +1,18 @@
-The g is crafted to have 2 filelog topological heads in a linear
-changeset graph
-
$ hg init a
+
$ cd a
$ echo a > a
- $ echo f > f
$ hg ci -Ama -d '1 0'
adding a
- adding f
$ hg cp a b
- $ hg cp f g
$ hg ci -mb -d '2 0'
$ mkdir dir
$ hg mv b dir
- $ echo g >> g
- $ echo f >> f
$ hg ci -mc -d '3 0'
$ hg mv a b
- $ hg cp -f f g
$ echo a > d
$ hg add d
$ hg ci -md -d '4 0'
@@ -29,7 +21,7 @@ changeset graph
$ hg ci -me -d '5 0'
$ hg log a
- changeset: 0:9161b9aeaf16
+ changeset: 0:8580ff50825a
user: test
date: Thu Jan 01 00:00:01 1970 +0000
summary: a
@@ -38,34 +30,34 @@ changeset graph
-f, directory
$ hg log -f dir
- abort: cannot follow file not in parent revision: "dir"
+ abort: cannot follow nonexistent file: "dir"
[255]
-f, but no args
$ hg log -f
- changeset: 4:7e4639b4691b
+ changeset: 4:66c1345dc4f9
tag: tip
user: test
date: Thu Jan 01 00:00:05 1970 +0000
summary: e
- changeset: 3:2ca5ba701980
+ changeset: 3:7c6c671bb7cc
user: test
date: Thu Jan 01 00:00:04 1970 +0000
summary: d
- changeset: 2:f8954cd4dc1f
+ changeset: 2:41dd4284081e
user: test
date: Thu Jan 01 00:00:03 1970 +0000
summary: c
- changeset: 1:d89b0a12d229
+ changeset: 1:784de7cef101
user: test
date: Thu Jan 01 00:00:02 1970 +0000
summary: b
- changeset: 0:9161b9aeaf16
+ changeset: 0:8580ff50825a
user: test
date: Thu Jan 01 00:00:01 1970 +0000
summary: a
@@ -73,12 +65,11 @@ changeset graph
one rename
- $ hg up -q 2
$ hg log -vf a
- changeset: 0:9161b9aeaf16
+ changeset: 0:8580ff50825a
user: test
date: Thu Jan 01 00:00:01 1970 +0000
- files: a f
+ files: a
description:
a
@@ -86,9 +77,8 @@ one rename
many renames
- $ hg up -q tip
$ hg log -vf e
- changeset: 4:7e4639b4691b
+ changeset: 4:66c1345dc4f9
tag: tip
user: test
date: Thu Jan 01 00:00:05 1970 +0000
@@ -97,26 +87,26 @@ many renames
e
- changeset: 2:f8954cd4dc1f
+ changeset: 2:41dd4284081e
user: test
date: Thu Jan 01 00:00:03 1970 +0000
- files: b dir/b f g
+ files: b dir/b
description:
c
- changeset: 1:d89b0a12d229
+ changeset: 1:784de7cef101
user: test
date: Thu Jan 01 00:00:02 1970 +0000
- files: b g
+ files: b
description:
b
- changeset: 0:9161b9aeaf16
+ changeset: 0:8580ff50825a
user: test
date: Thu Jan 01 00:00:01 1970 +0000
- files: a f
+ files: a
description:
a
@@ -125,36 +115,35 @@ many renames
log -pf dir/b
- $ hg up -q 3
$ hg log -pf dir/b
- changeset: 2:f8954cd4dc1f
+ changeset: 2:41dd4284081e
user: test
date: Thu Jan 01 00:00:03 1970 +0000
summary: c
- diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
+ diff -r 784de7cef101 -r 41dd4284081e dir/b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
@@ -0,0 +1,1 @@
+a
- changeset: 1:d89b0a12d229
+ changeset: 1:784de7cef101
user: test
date: Thu Jan 01 00:00:02 1970 +0000
summary: b
- diff -r 9161b9aeaf16 -r d89b0a12d229 b
+ diff -r 8580ff50825a -r 784de7cef101 b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/b Thu Jan 01 00:00:02 1970 +0000
@@ -0,0 +1,1 @@
+a
- changeset: 0:9161b9aeaf16
+ changeset: 0:8580ff50825a
user: test
date: Thu Jan 01 00:00:01 1970 +0000
summary: a
- diff -r 000000000000 -r 9161b9aeaf16 a
+ diff -r 000000000000 -r 8580ff50825a a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/a Thu Jan 01 00:00:01 1970 +0000
@@ -0,0 +1,1 @@
@@ -164,53 +153,39 @@ log -pf dir/b
log -vf dir/b
$ hg log -vf dir/b
- changeset: 2:f8954cd4dc1f
+ changeset: 2:41dd4284081e
user: test
date: Thu Jan 01 00:00:03 1970 +0000
- files: b dir/b f g
+ files: b dir/b
description:
c
- changeset: 1:d89b0a12d229
+ changeset: 1:784de7cef101
user: test
date: Thu Jan 01 00:00:02 1970 +0000
- files: b g
+ files: b
description:
b
- changeset: 0:9161b9aeaf16
+ changeset: 0:8580ff50825a
user: test
date: Thu Jan 01 00:00:01 1970 +0000
- files: a f
+ files: a
description:
a
--f and multiple filelog heads
-
- $ hg up -q 2
- $ hg log -f g --template '{rev}\n'
- 2
- 1
- 0
- $ hg up -q tip
- $ hg log -f g --template '{rev}\n'
- 3
- 2
- 0
-
-
log copies with --copies
$ hg log -vC --template '{rev} {file_copies}\n'
4 e (dir/b)
- 3 b (a)g (f)
+ 3 b (a)
2 dir/b (b)
- 1 b (a)g (f)
+ 1 b (a)
0
log copies switch without --copies, with old filecopy template
@@ -226,16 +201,16 @@ log copies switch with --copies
$ hg log -vC --template '{rev} {file_copies_switch}\n'
4 e (dir/b)
- 3 b (a)g (f)
+ 3 b (a)
2 dir/b (b)
- 1 b (a)g (f)
+ 1 b (a)
0
log copies with hardcoded style and with --style=default
$ hg log -vC -r4
- changeset: 4:7e4639b4691b
+ changeset: 4:66c1345dc4f9
tag: tip
user: test
date: Thu Jan 01 00:00:05 1970 +0000
@@ -246,7 +221,7 @@ log copies with hardcoded style and with --style=default
$ hg log -vC -r4 --style=default
- changeset: 4:7e4639b4691b
+ changeset: 4:66c1345dc4f9
tag: tip
user: test
date: Thu Jan 01 00:00:05 1970 +0000
@@ -273,26 +248,24 @@ log copies, non-linear manifest
log copies, execute bit set
-#if execbit
$ chmod +x e
$ hg ci -me3 -d '7 0'
$ hg log -v --template '{rev} {file_copies}\n' -r 6
6
-#endif
log -p d
$ hg log -pv d
- changeset: 3:2ca5ba701980
+ changeset: 3:7c6c671bb7cc
user: test
date: Thu Jan 01 00:00:04 1970 +0000
- files: a b d g
+ files: a b d
description:
d
- diff -r f8954cd4dc1f -r 2ca5ba701980 d
+ diff -r 41dd4284081e -r 7c6c671bb7cc d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/d Thu Jan 01 00:00:04 1970 +0000
@@ -0,0 +1,1 @@
@@ -303,18 +276,18 @@ log -p d
log --removed file
$ hg log --removed -v a
- changeset: 3:2ca5ba701980
+ changeset: 3:7c6c671bb7cc
user: test
date: Thu Jan 01 00:00:04 1970 +0000
- files: a b d g
+ files: a b d
description:
d
- changeset: 0:9161b9aeaf16
+ changeset: 0:8580ff50825a
user: test
date: Thu Jan 01 00:00:01 1970 +0000
- files: a f
+ files: a
description:
a
@@ -323,20 +296,20 @@ log --removed file
log --removed revrange file
$ hg log --removed -v -r0:2 a
- changeset: 0:9161b9aeaf16
+ changeset: 0:8580ff50825a
user: test
date: Thu Jan 01 00:00:01 1970 +0000
- files: a f
+ files: a
description:
a
- $ cd ..
+
log --follow tests
- $ hg init follow
- $ cd follow
+ $ hg init ../follow
+ $ cd ../follow
$ echo base > base
$ hg ci -Ambase -d '1 0'
@@ -539,6 +512,34 @@ log -k r1
date: Thu Jan 01 00:00:01 1970 +0000
summary: r1
+log -d " " (whitespaces only)
+
+ $ hg log -d " "
+ abort: dates cannot consist entirely of whitespace
+ [255]
+
+log -d -1
+
+ $ hg log -d -1
+
+log -d ">"
+
+ $ hg log -d ">"
+ abort: invalid day spec, use '>DATE'
+ [255]
+
+log -d "<"
+
+ $ hg log -d "<"
+ abort: invalid day spec, use '<DATE'
+ [255]
+
+Negative ranges
+ $ hg log -d "--2"
+ abort: -2 must be nonnegative (see 'hg help dates')
+ [255]
+
+
log -p -l2 --color=always
$ hg --config extensions.color= --config color.mode=ansi \
@@ -586,9 +587,6 @@ log -r tip --stat
$ cd ..
-
-User
-
$ hg init usertest
$ cd usertest
@@ -629,7 +627,6 @@ User
adding a
$ hg branch test
marked working directory as branch test
- (branches are permanent and global, did you want a bookmark?)
$ echo b > b
$ hg ci -A -m "commit on test"
adding b
@@ -873,11 +870,12 @@ log -p -R repo
+a
- $ cd ../..
+ $ cd ..
$ hg init follow2
$ cd follow2
+
# Build the following history:
# tip - o - x - o - x - x
# \ /
@@ -922,7 +920,7 @@ log -p -R repo
$ hg merge 7
merging foo
warning: conflicts during merge.
- merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
+ merging foo 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]
@@ -933,7 +931,7 @@ log -p -R repo
$ hg merge 4
merging foo
warning: conflicts during merge.
- merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
+ merging foo failed!
1 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]
@@ -941,7 +939,7 @@ log -p -R repo
$ hg resolve -m foo
$ hg ci -m "Last merge, related"
- $ hg log --graph
+ $ hg --config "extensions.graphlog=" glog
@ changeset: 10:4dae8563d2c5
|\ tag: tip
| | parent: 9:7b35701b003e
@@ -1051,7 +1049,6 @@ Also check when maxrev < lastrevfilelog
date: Thu Jan 01 00:00:00 1970 +0000
summary: add foo, related
- $ cd ..
Issue2383: hg log showing _less_ differences than hg diff
@@ -1128,8 +1125,7 @@ Diff here should be the same:
'hg log -r rev fn' when last(filelog(fn)) != rev
- $ hg init simplelog
- $ cd simplelog
+ $ hg init simplelog; cd simplelog
$ echo f > a
$ hg ci -Am'a' -d '0 0'
adding a
@@ -1146,7 +1142,7 @@ Diff here should be the same:
> def reposetup(ui, repo):
> for line in repo.opener('hidden'):
> ctx = repo[line.strip()]
- > repo.hiddenrevs.add(ctx.rev())
+ > repo.changelog.hiddenrevs.add(ctx.rev())
> EOF
$ echo '[extensions]' >> $HGRCPATH
$ echo "hidden=$HGTMP/testhidden.py" >> $HGRCPATH
@@ -1160,56 +1156,3 @@ Diff here should be the same:
$ hg log --template='{rev}:{node}\n' --hidden
1:a765632148dc55d38c35c4f247c618701886cb2f
0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
-
-clear extensions configuration
- $ echo '[extensions]' >> $HGRCPATH
- $ echo "hidden=!" >> $HGRCPATH
- $ cd ..
-
-test -u/-k for problematic encoding
-# unicode: cp932:
-# u30A2 0x83 0x41(= 'A')
-# u30C2 0x83 0x61(= 'a')
-
- $ hg init problematicencoding
- $ cd problematicencoding
-
- $ python > setup.sh <<EOF
- > print u'''
- > echo a > text
- > hg add text
- > hg --encoding utf-8 commit -u '\u30A2' -m none
- > echo b > text
- > hg --encoding utf-8 commit -u '\u30C2' -m none
- > echo c > text
- > hg --encoding utf-8 commit -u none -m '\u30A2'
- > echo d > text
- > hg --encoding utf-8 commit -u none -m '\u30C2'
- > '''.encode('utf-8')
- > EOF
- $ sh < setup.sh
-
-test in problematic encoding
- $ python > test.sh <<EOF
- > print u'''
- > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
- > echo ====
- > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
- > echo ====
- > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
- > echo ====
- > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
- > '''.encode('cp932')
- > EOF
- $ sh < test.sh
- 0
- ====
- 1
- ====
- 2
- 0
- ====
- 3
- 1
-
- $ cd ..