annotate tests/test-import-merge.t @ 20742:3681de20b0a7

parsers: fail fast if Python has wrong minor version (issue4110) This change causes an informative ImportError to be raised when importing the parsers extension module if the minor version of the currently-running Python interpreter doesn't match that of the Python used when compiling the extension module. This change also exposes a parsers.versionerrortext constant in the C implementation of the module. Its presence can be used to determine whether this behavior is present in a version of the module. The value of the constant is the leading text of the ImportError raised and is set to "Python minor version mismatch". Here is an example of what the new error looks like: Traceback (most recent call last): File "test.py", line 1, in <module> import mercurial.parsers ImportError: Python minor version mismatch: The Mercurial extension modules were compiled with Python 2.7.6, but Mercurial is currently using Python with sys.hexversion=33883888: Python 2.5.6 (r256:88840, Nov 18 2012, 05:37:10) [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] at: /opt/local/Library/Frameworks/Python.framework/Versions/2.5/Resources/ Python.app/Contents/MacOS/Python The reason for raising an error in this scenario is that Python's C API is known not to be compatible from minor version to minor version, even if sys.api_version is the same. See for example this Python bug report about incompatibilities between 2.5 and 2.6+: http://bugs.python.org/issue8118 These incompatibilities can cause Mercurial to break in mysterious, unforeseen ways. For example, when Mercurial compiled with Python 2.7 was run with 2.5, the following crash occurred when running "hg status": http://bz.selenic.com/show_bug.cgi?id=4110 After this crash was fixed, running with Python 2.5 no longer crashes, but the following puzzling behavior still occurs: $ hg status ... File ".../mercurial/changelog.py", line 123, in __init__ revlog.revlog.__init__(self, opener, "00changelog.i") File ".../mercurial/revlog.py", line 251, in __init__ d = self._io.parseindex(i, self._inline) File ".../mercurial/revlog.py", line 158, in parseindex index, cache = parsers.parse_index2(data, inline) TypeError: data is not a string which can be reproduced more simply with: import mercurial.parsers as parsers parsers.parse_index2("", True) Both the crash and the TypeError occurred because the Python C API's PyString_Check() returns the wrong value when the C header files from Python 2.7 are run with Python 2.5. This is an example of an incompatibility of the sort mentioned in the Python bug report above. Failing fast with an informative error message results in a better user experience in cases like the above. The information in the ImportError also simplifies troubleshooting for those on Mercurial mailing lists, the bug tracker, etc. This patch only adds the version check to parsers.c, which is sufficient to affect command-line commands like "hg status" and "hg summary". An idea for a future improvement is to move the version-checking C code to a more central location, and have it run when importing all Mercurial extension modules and not just parsers.c.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Wed, 04 Dec 2013 20:38:27 -0800
parents 3a3731a60354
children f3200bf460a8 0c838e7459a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15511
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1 $ echo "[extensions]" >> $HGRCPATH
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2 $ echo "mq=" >> $HGRCPATH
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
3
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
4 $ tipparents() {
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5 > hg parents --template "{rev}:{node|short} {desc|firstline}\n" -r tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6 > }
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8 Test import and merge diffs
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10 $ hg init repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11 $ cd repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12 $ echo a > a
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
13 $ hg ci -Am adda
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
14 adding a
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
15 $ echo a >> a
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
16 $ hg ci -m changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
17 $ echo c > c
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
18 $ hg ci -Am addc
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
19 adding c
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20 $ hg up 0
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
21 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
22 $ echo b > b
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
23 $ hg ci -Am addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
24 adding b
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
25 created new head
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
26 $ hg up 1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
27 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
28 $ hg merge 3
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
30 (branch merge, don't forget to commit)
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
31 $ hg ci -m merge
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
32 $ hg export . > ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
33 $ cd ..
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
34 $ hg clone -r2 repo repo2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
35 adding changesets
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
36 adding manifests
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
37 adding file changes
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
38 added 3 changesets with 3 changes to 2 files
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
39 updating to branch default
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
40 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
41 $ cd repo2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
42 $ hg pull -r3 ../repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
43 pulling from ../repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
44 searching for changes
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
45 adding changesets
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
46 adding manifests
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
47 adding file changes
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
48 added 1 changesets with 1 changes to 1 files (+1 heads)
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
49 (run 'hg heads' to see heads, 'hg merge' to merge)
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
50
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
51 Test without --exact and diff.p1 == workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
52
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
53 $ hg up 1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
54 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
55 $ hg import ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
56 applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
57 $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
58 1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
59 3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
60 $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
61 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
62
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
63 Test without --exact and diff.p1 != workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
64
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
65 $ hg up 2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
67 $ hg import ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
68 applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
69 $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
70 2:890ecaa90481 addc
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
71 $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
72 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
73
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
74 Test with --exact
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
75
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
76 $ hg import --exact ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
77 applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
78 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
79 $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
80 1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
81 3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
82 $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
83 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
84
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
85 Test with --bypass and diff.p1 == workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
86
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
87 $ hg up 1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
88 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
89 $ hg import --bypass ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
90 applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
91 $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
92 1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
93 3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
94 $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
95
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
96 Test with --bypass and diff.p1 != workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
97
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
98 $ hg up 2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
99 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
100 $ hg import --bypass ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
101 applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
102 $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
103 2:890ecaa90481 addc
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
104 $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
105
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
106 Test with --bypass and --exact
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
107
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
108 $ hg import --bypass --exact ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
109 applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
110 $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
111 1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
112 3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
113 $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
114
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15511
diff changeset
115 $ cd ..
18656
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
116
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
117 Test that --exact on a bad header doesn't corrupt the repo (issue3616)
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
118
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
119 $ hg init repo3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
120 $ cd repo3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
121 $ echo a>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
122 $ hg ci -Aqm0
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
123 $ echo a>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
124 $ hg ci -m1
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
125 $ echo a>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
126 $ hg ci -m2
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
127 $ echo a>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
128 $ echo b>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
129 $ echo a>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
130 $ hg ci -m3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
131 $ hg export 2 | head -7 > ../a.patch
19628
3193b23eec61 solaris: tests can't use tail -n
Danek Duvall <danek.duvall@oracle.com>
parents: 18656
diff changeset
132 $ hg export tip > out
20303
3a3731a60354 test-import-merge: mangle file in binary mode
Matt Mackall <mpm@selenic.com>
parents: 19628
diff changeset
133 >>> apatch = open("../a.patch", "ab")
19628
3193b23eec61 solaris: tests can't use tail -n
Danek Duvall <danek.duvall@oracle.com>
parents: 18656
diff changeset
134 >>> apatch.write("".join(open("out").readlines()[7:]))
18656
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
135
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
136 $ cd ..
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
137 $ hg clone -qr0 repo3 repo3-clone
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
138 $ cd repo3-clone
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
139 $ hg pull -qr1 ../repo3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
140
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
141 $ hg import --exact ../a.patch
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
142 applying ../a.patch
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
143 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
144 patching file a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
145 Hunk #1 succeeded at 1 with fuzz 1 (offset -1 lines).
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
146 transaction abort!
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
147 rollback completed
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
148 abort: patch is damaged or loses information
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
149 [255]
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
150 $ hg verify
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
151 checking changesets
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
152 checking manifests
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
153 crosschecking files in changesets and manifests
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
154 checking files
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
155 1 files, 2 changesets, 2 total revisions