Show More
@@ -155,6 +155,8 b' class hunk(object):' | |||||
155 |
|
155 | |||
156 | def write(self, fp): |
|
156 | def write(self, fp): | |
157 | delta = len(self.before) + len(self.after) |
|
157 | delta = len(self.before) + len(self.after) | |
|
158 | if self.after and self.after[-1] == '\\ No newline at end of file\n': | |||
|
159 | delta -= 1 | |||
158 | fromlen = delta + self.removed |
|
160 | fromlen = delta + self.removed | |
159 | tolen = delta + self.added |
|
161 | tolen = delta + self.added | |
160 | fp.write('@@ -%d,%d +%d,%d @@%s\n' % |
|
162 | fp.write('@@ -%d,%d +%d,%d @@%s\n' % | |
@@ -206,7 +208,7 b' def parsepatch(fp):' | |||||
206 | if self.context: |
|
208 | if self.context: | |
207 | self.before = self.context |
|
209 | self.before = self.context | |
208 | self.context = [] |
|
210 | self.context = [] | |
209 |
self.hunk = |
|
211 | self.hunk = hunk | |
210 |
|
212 | |||
211 | def newfile(self, hdr): |
|
213 | def newfile(self, hdr): | |
212 | self.addcontext([]) |
|
214 | self.addcontext([]) | |
@@ -467,9 +469,16 b' def dorecord(ui, repo, committer, *pats,' | |||||
467 |
|
469 | |||
468 | # 3b. (apply) |
|
470 | # 3b. (apply) | |
469 | if dopatch: |
|
471 | if dopatch: | |
470 | ui.debug('applying patch\n') |
|
472 | try: | |
471 |
ui.debug( |
|
473 | ui.debug('applying patch\n') | |
472 | patch.internalpatch(fp, ui, 1, repo.root) |
|
474 | ui.debug(fp.getvalue()) | |
|
475 | patch.internalpatch(fp, ui, 1, repo.root) | |||
|
476 | except patch.PatchError, err: | |||
|
477 | s = str(err) | |||
|
478 | if s: | |||
|
479 | raise util.Abort(s) | |||
|
480 | else: | |||
|
481 | raise util.Abort(_('patch failed to apply')) | |||
473 | del fp |
|
482 | del fp | |
474 |
|
483 | |||
475 | # 4. We prepared working directory according to filtered patch. |
|
484 | # 4. We prepared working directory according to filtered patch. |
General Comments 0
You need to be logged in to leave comments.
Login now