Show More
@@ -1007,17 +1007,12 b' def iterhunks(ui, fp, sourcefile=None):' | |||||
1007 | current_hunk = None |
|
1007 | current_hunk = None | |
1008 | if ((sourcefile or state == BFILE) and ((not context and x[0] == '@') or |
|
1008 | if ((sourcefile or state == BFILE) and ((not context and x[0] == '@') or | |
1009 | ((context is not False) and x.startswith('***************')))): |
|
1009 | ((context is not False) and x.startswith('***************')))): | |
1010 | try: |
|
|||
1011 |
|
|
1010 | if context is None and x.startswith('***************'): | |
1012 |
|
|
1011 | context = True | |
1013 |
|
|
1012 | gpatch = changed.get(bfile) | |
1014 |
|
|
1013 | create = afile == '/dev/null' or gpatch and gpatch.op == 'ADD' | |
1015 |
|
|
1014 | remove = bfile == '/dev/null' or gpatch and gpatch.op == 'DELETE' | |
1016 |
|
|
1015 | current_hunk = hunk(x, hunknum + 1, lr, context, create, remove) | |
1017 | except PatchError, err: |
|
|||
1018 | ui.debug(err) |
|
|||
1019 | current_hunk = None |
|
|||
1020 | continue |
|
|||
1021 | hunknum += 1 |
|
1016 | hunknum += 1 | |
1022 | if emitfile: |
|
1017 | if emitfile: | |
1023 | emitfile = False |
|
1018 | emitfile = False |
@@ -150,6 +150,25 b' import of plain diff should be ok with -' | |||||
150 | $ rm -r b |
|
150 | $ rm -r b | |
151 |
|
151 | |||
152 |
|
152 | |||
|
153 | import of malformed plain diff should fail | |||
|
154 | ||||
|
155 | $ hg clone -r0 a b | |||
|
156 | requesting all changes | |||
|
157 | adding changesets | |||
|
158 | adding manifests | |||
|
159 | adding file changes | |||
|
160 | added 1 changesets with 2 changes to 2 files | |||
|
161 | updating to branch default | |||
|
162 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
163 | $ hg --cwd a diff -r0:1 > tip.patch | |||
|
164 | $ sed 's/1,1/foo/' < tip.patch > broken.patch | |||
|
165 | $ hg --cwd b import -mpatch ../broken.patch | |||
|
166 | applying ../broken.patch | |||
|
167 | abort: bad hunk #1 | |||
|
168 | [255] | |||
|
169 | $ rm -r b | |||
|
170 | ||||
|
171 | ||||
153 | hg -R repo import |
|
172 | hg -R repo import | |
154 | put the clone in a subdir - having a directory named "a" |
|
173 | put the clone in a subdir - having a directory named "a" | |
155 | used to hide a bug. |
|
174 | used to hide a bug. |
General Comments 0
You need to be logged in to leave comments.
Login now