Mercurial > hg
comparison tests/test-diff-change @ 7628:9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
author | Stepan Koltsov <yozh@mx1.ru> |
---|---|
date | Tue, 13 Jan 2009 10:44:16 +0100 |
parents | |
children | 89c2b78faec4 |
comparison
equal
deleted
inserted
replaced
7627:fb32ae9c76e7 | 7628:9c6ae2e09e11 |
---|---|
1 #!/bin/sh -e | |
2 | |
3 # test of hg diff --change | |
4 | |
5 set -e | |
6 | |
7 ec() { | |
8 echo "invoking $@:" | |
9 "$@" | |
10 } | |
11 | |
12 hg init a | |
13 cd a | |
14 | |
15 echo "first" > file.txt | |
16 hg add file.txt | |
17 hg commit -m 'first commit' # 0 | |
18 | |
19 echo "second" > file.txt | |
20 hg commit -m 'second commit' # 1 | |
21 | |
22 echo "third" > file.txt | |
23 hg commit -m 'third commit' # 2 | |
24 | |
25 ec hg diff --nodates --change 1 | |
26 | |
27 echo | |
28 | |
29 #rev=$(hg log -r 1 --template '{node|short}') | |
30 rev=e9b286083166 | |
31 ec hg diff --nodates --change "$rev" | |
32 | |
33 ## | |
34 # Testing diff -c when merge | |
35 | |
36 for i in 1 2 3 4 5 6 7 8 9 10; do | |
37 echo $i >> file.txt | |
38 done | |
39 hg commit -m "lots of text" # 3 | |
40 | |
41 sed -i -e 's,^2$,x,' file.txt | |
42 hg commit -m "changed 2 to x" # 4 | |
43 | |
44 hg up -r 3 > /dev/null 2>&1 # updated, merged, removed, unresolved | |
45 sed -i -e 's,^8$,y,' file.txt | |
46 hg commit -m "change 8 to y" > /dev/null 2>&1 # 5 # created new head | |
47 | |
48 hg up -C -r 4 > /dev/null 2>&1 # updated, merged, removed, unresolved | |
49 hg merge -r 5 > /dev/null 2>&1 # updated, merged, removed, unresolved | |
50 hg commit -m "merging 8 to y" # 6 | |
51 | |
52 echo | |
53 ec hg diff --nodates --change 6 # must be similar to hg diff --nodates --change 5 | |
54 | |
55 #echo | |
56 #hg log | |
57 | |
58 echo | |
59 echo "EOF" | |
60 | |
61 # vim: set ts=4 sw=4 et: |