##// END OF EJS Templates
mq: handle empty patches more gracefully (issue1501)
Matt Mackall -
r7782:14042927 default
parent child Browse files
Show More
@@ -551,9 +551,13 b' class queue:'
551 message.append(_("\nimported patch %s") % patchname)
551 message.append(_("\nimported patch %s") % patchname)
552 message = '\n'.join(message)
552 message = '\n'.join(message)
553
553
554 (patcherr, files, fuzz) = self.patch(repo, pf)
554 if ph.haspatch:
555 all_files.update(files)
555 (patcherr, files, fuzz) = self.patch(repo, pf)
556 patcherr = not patcherr
556 all_files.update(files)
557 patcherr = not patcherr
558 else:
559 self.ui.warn(_("patch %s is empty\n") % patchname)
560 patcherr, files, fuzz = 0, [], 0
557
561
558 if merge and files:
562 if merge and files:
559 # Mark as removed/merged and update dirstate parent info
563 # Mark as removed/merged and update dirstate parent info
@@ -583,12 +587,8 b' class queue:'
583 self.applied.append(statusentry(hex(n), patchname))
587 self.applied.append(statusentry(hex(n), patchname))
584
588
585 if patcherr:
589 if patcherr:
586 if not ph.haspatch:
590 self.ui.warn(_("patch failed, rejects left in working dir\n"))
587 self.ui.warn(_("patch %s is empty\n") % patchname)
591 err = 1
588 err = 0
589 else:
590 self.ui.warn(_("patch failed, rejects left in working dir\n"))
591 err = 1
592 break
592 break
593
593
594 if fuzz and strict:
594 if fuzz and strict:
@@ -30,6 +30,7 b' abort: cannot delete revision 2 above ap'
30 now at: b
30 now at: b
31 abort: unknown revision 'c'!
31 abort: unknown revision 'c'!
32 applying c
32 applying c
33 patch c is empty
33 now at: c
34 now at: c
34 c
35 c
35 3 imported patch c
36 3 imported patch c
@@ -486,8 +486,6 b' patch queue now empty'
486 abort: local changes found, refresh first
486 abort: local changes found, refresh first
487 % apply force, should not discard changes with empty patch
487 % apply force, should not discard changes with empty patch
488 applying empty
488 applying empty
489 patch: **** Only garbage was found in the patch input.
490 patch failed, unable to continue (try -v)
491 patch empty is empty
489 patch empty is empty
492 now at: empty
490 now at: empty
493 diff -r bf5fc3f07a0a hello.txt
491 diff -r bf5fc3f07a0a hello.txt
General Comments 0
You need to be logged in to leave comments. Login now