Mercurial > hg
annotate tests/test-rebase-scenario-global @ 8810:ac92775b3b80
Add patch.eol to ignore EOLs when patching (issue1019)
The intent is to fix many issues involving patching when win32ext is enabled.
With win32ext, the working directory and repository files EOLs are not the same
which means that patches made on a non-win32ext host do not apply cleanly
because of EOLs discrepancies. A theorically correct approach would be
transform either the patched file or the patch content with the
encoding/decoding filters used by win32ext. This solution is tricky to
implement and invasive, instead we prefer to address the win32ext case, by
offering a way to ignore input EOLs when patching and rewriting them when
saving the patched result.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 15 Jun 2009 00:03:26 +0200 |
parents | 8766fee6f225 |
children | 341182ac95e4 |
rev | line source |
---|---|
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
1 #!/bin/sh |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
2 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
3 echo "[extensions]" >> $HGRCPATH |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
4 echo "graphlog=" >> $HGRCPATH |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
5 echo "rebase=" >> $HGRCPATH |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
6 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
7 BASE=`pwd` |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
8 |
6910 | 9 addcommit () { |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
10 echo $1 > $1 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
11 hg add $1 |
8168
8766fee6f225
tests: removed redundant "-u test" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
6910
diff
changeset
|
12 hg commit -d "${2} 0" -m $1 |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
13 } |
6910 | 14 |
15 commit () { | |
8168
8766fee6f225
tests: removed redundant "-u test" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
6910
diff
changeset
|
16 hg commit -d "${2} 0" -m $1 |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
17 } |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
18 |
6910 | 19 createrepo () { |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
20 cd $BASE |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
21 rm -rf a |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
22 hg init a |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
23 cd a |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
24 addcommit "A" 0 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
25 addcommit "B" 1 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
26 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
27 hg update -C 0 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
28 addcommit "C" 2 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
29 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
30 hg update -C 0 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
31 addcommit "D" 3 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
32 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
33 hg merge -r 2 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
34 commit "E" 4 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
35 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
36 hg update -C 3 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
37 addcommit "F" 5 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
38 } |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
39 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
40 createrepo > /dev/null 2>&1 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
41 hg glog --template '{rev}: {desc}\n' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
42 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
43 echo '% Rebasing' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
44 echo '% B onto F - simple rebase' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
45 hg rebase -s 1 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
46 hg glog --template '{rev}: {desc}\n' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
47 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
48 createrepo > /dev/null 2>&1 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
49 echo '% B onto D - intermediate point' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
50 hg rebase -s 1 -d 3 2>&1 | sed 's/\(saving bundle to \).*/\1/' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
51 hg glog --template '{rev}: {desc}\n' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
52 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
53 createrepo > /dev/null 2>&1 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
54 echo '% C onto F - skip of E' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
55 hg rebase -s 2 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
56 hg glog --template '{rev}: {desc}\n' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
57 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
58 createrepo > /dev/null 2>&1 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
59 echo '% D onto C - rebase of a branching point (skip E)' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
60 hg rebase -s 3 -d 2 2>&1 | sed 's/\(saving bundle to \).*/\1/' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
61 hg glog --template '{rev}: {desc}\n' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
62 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
63 createrepo > /dev/null 2>&1 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
64 echo '% E onto F - merged revision having a parent in ancestors of target' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
65 hg rebase -s 4 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
66 hg glog --template '{rev}: {desc}\n' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
67 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
68 createrepo > /dev/null 2>&1 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
69 echo '% D onto B - E maintains C as parent' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
70 hg rebase -s 3 -d 1 2>&1 | sed 's/\(saving bundle to \).*/\1/' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
71 hg glog --template '{rev}: {desc}\n' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
72 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
73 echo '% These will fail' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
74 createrepo > /dev/null 2>&1 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
75 echo '% E onto D - rebase onto an ancestor' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
76 hg rebase -s 4 -d 3 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
77 echo '% D onto E - rebase onto a descendant' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
78 hg rebase -s 3 -d 4 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
79 echo '% E onto B - merge revision with both parents not in ancestors of target' |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
80 hg rebase -s 4 -d 1 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
81 |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
82 exit 0 |