mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
mq: handle empty patches more gracefully (issue1501)
This commit is contained in:
parent
b649059d2b
commit
1a2d87e4e1
18
hgext/mq.py
18
hgext/mq.py
@ -551,9 +551,13 @@ class queue:
|
||||
message.append(_("\nimported patch %s") % patchname)
|
||||
message = '\n'.join(message)
|
||||
|
||||
(patcherr, files, fuzz) = self.patch(repo, pf)
|
||||
all_files.update(files)
|
||||
patcherr = not patcherr
|
||||
if ph.haspatch:
|
||||
(patcherr, files, fuzz) = self.patch(repo, pf)
|
||||
all_files.update(files)
|
||||
patcherr = not patcherr
|
||||
else:
|
||||
self.ui.warn(_("patch %s is empty\n") % patchname)
|
||||
patcherr, files, fuzz = 0, [], 0
|
||||
|
||||
if merge and files:
|
||||
# Mark as removed/merged and update dirstate parent info
|
||||
@ -583,12 +587,8 @@ class queue:
|
||||
self.applied.append(statusentry(hex(n), patchname))
|
||||
|
||||
if patcherr:
|
||||
if not ph.haspatch:
|
||||
self.ui.warn(_("patch %s is empty\n") % patchname)
|
||||
err = 0
|
||||
else:
|
||||
self.ui.warn(_("patch failed, rejects left in working dir\n"))
|
||||
err = 1
|
||||
self.ui.warn(_("patch failed, rejects left in working dir\n"))
|
||||
err = 1
|
||||
break
|
||||
|
||||
if fuzz and strict:
|
||||
|
@ -30,6 +30,7 @@ abort: cannot delete revision 2 above applied patches
|
||||
now at: b
|
||||
abort: unknown revision 'c'!
|
||||
applying c
|
||||
patch c is empty
|
||||
now at: c
|
||||
c
|
||||
3 imported patch c
|
||||
|
@ -486,8 +486,6 @@ patch queue now empty
|
||||
abort: local changes found, refresh first
|
||||
% apply force, should not discard changes with empty patch
|
||||
applying empty
|
||||
patch: **** Only garbage was found in the patch input.
|
||||
patch failed, unable to continue (try -v)
|
||||
patch empty is empty
|
||||
now at: empty
|
||||
diff -r bf5fc3f07a0a hello.txt
|
||||
|
Loading…
Reference in New Issue
Block a user