Show More
@@ -1,40 +1,40 b'' | |||||
1 | Testing that convert.hg.preserve-hash=true can be used to make hg |
|
1 | Testing that convert.hg.preserve-hash=true can be used to make hg | |
2 | convert from hg repo to hg repo preserve hashes, even if the |
|
2 | convert from hg repo to hg repo preserve hashes, even if the | |
3 | computation of the files list in commits change slightly between hg |
|
3 | computation of the files list in commits change slightly between hg | |
4 | versions. |
|
4 | versions. | |
5 |
|
5 | |||
6 | $ cat <<'EOF' >> "$HGRCPATH" |
|
6 | $ cat <<'EOF' >> "$HGRCPATH" | |
7 | > [extensions] |
|
7 | > [extensions] | |
8 | > convert = |
|
8 | > convert = | |
9 | > EOF |
|
9 | > EOF | |
10 | $ cat <<'EOF' > changefileslist.py |
|
10 | $ cat <<'EOF' > changefileslist.py | |
11 | > from mercurial import (changelog, extensions) |
|
11 | > from mercurial import (changelog, extensions) | |
12 | > def wrap(orig, clog, manifest, files, *args, **kwargs): |
|
12 | > def wrap(orig, clog, manifest, files, *args, **kwargs): | |
13 | > return orig(clog, manifest, ["a"], *args, **kwargs) |
|
13 | > return orig(clog, manifest, [b"a"], *args, **kwargs) | |
14 | > def extsetup(ui): |
|
14 | > def extsetup(ui): | |
15 | > extensions.wrapfunction(changelog.changelog, 'add', wrap) |
|
15 | > extensions.wrapfunction(changelog.changelog, 'add', wrap) | |
16 | > EOF |
|
16 | > EOF | |
17 |
|
17 | |||
18 | $ hg init repo |
|
18 | $ hg init repo | |
19 | $ cd repo |
|
19 | $ cd repo | |
20 | $ echo a > a; hg commit -qAm a |
|
20 | $ echo a > a; hg commit -qAm a | |
21 | $ echo b > a; hg commit -qAm b |
|
21 | $ echo b > a; hg commit -qAm b | |
22 | $ hg up -qr 0; echo c > c; hg commit -qAm c |
|
22 | $ hg up -qr 0; echo c > c; hg commit -qAm c | |
23 | $ hg merge -qr 1 |
|
23 | $ hg merge -qr 1 | |
24 | $ hg commit -m_ --config extensions.x=../changefileslist.py |
|
24 | $ hg commit -m_ --config extensions.x=../changefileslist.py | |
25 | $ hg log -r . -T '{node|short} {files|json}\n' |
|
25 | $ hg log -r . -T '{node|short} {files|json}\n' | |
26 | c085bbe93d59 ["a"] |
|
26 | c085bbe93d59 ["a"] | |
27 |
|
27 | |||
28 | Now that we have a commit with a files list that's not what the |
|
28 | Now that we have a commit with a files list that's not what the | |
29 | current hg version would create, check that convert either fixes it or |
|
29 | current hg version would create, check that convert either fixes it or | |
30 | keeps it depending on config: |
|
30 | keeps it depending on config: | |
31 |
|
31 | |||
32 | $ hg convert -q . ../convert |
|
32 | $ hg convert -q . ../convert | |
33 | $ hg --cwd ../convert log -r tip -T '{node|short} {files|json}\n' |
|
33 | $ hg --cwd ../convert log -r tip -T '{node|short} {files|json}\n' | |
34 | b7c4d4bbacd3 [] |
|
34 | b7c4d4bbacd3 [] | |
35 | $ rm -rf ../convert |
|
35 | $ rm -rf ../convert | |
36 |
|
36 | |||
37 | $ hg convert -q . ../convert --config convert.hg.preserve-hash=true |
|
37 | $ hg convert -q . ../convert --config convert.hg.preserve-hash=true | |
38 | $ hg --cwd ../convert log -r tip -T '{node|short} {files|json}\n' |
|
38 | $ hg --cwd ../convert log -r tip -T '{node|short} {files|json}\n' | |
39 | c085bbe93d59 ["a"] |
|
39 | c085bbe93d59 ["a"] | |
40 | $ rm -rf ../convert |
|
40 | $ rm -rf ../convert |
General Comments 0
You need to be logged in to leave comments.
Login now