##// END OF EJS Templates
transplant: properly skip empty changeset (issue4423)...
Pierre-Yves David -
r23781:49caef45 default
parent child Browse files
Show More
@@ -301,8 +301,12 b' class transplanter(object):'
301 301 '''recover last transaction and apply remaining changesets'''
302 302 if os.path.exists(os.path.join(self.path, 'journal')):
303 303 n, node = self.recover(repo, source, opts)
304 self.ui.status(_('%s transplanted as %s\n') % (short(node),
305 short(n)))
304 if n:
305 self.ui.status(_('%s transplanted as %s\n') % (short(node),
306 short(n)))
307 else:
308 self.ui.status(_('%s skipped due to empty diff\n')
309 % (short(node),))
306 310 seriespath = os.path.join(self.path, 'series')
307 311 if not os.path.exists(seriespath):
308 312 self.transplants.write()
@@ -343,12 +347,16 b' class transplanter(object):'
343 347 revlog.hex(parent))
344 348 if merge:
345 349 repo.setparents(p1, parents[1])
346 n = repo.commit(message, user, date, extra=extra,
347 editor=self.getcommiteditor())
348 if not n:
349 raise util.Abort(_('commit failed'))
350 if not merge:
351 self.transplants.set(n, node)
350 modified, added, removed, deleted = repo.status()[:4]
351 if merge or modified or added or removed or deleted:
352 n = repo.commit(message, user, date, extra=extra,
353 editor=self.getcommiteditor())
354 if not n:
355 raise util.Abort(_('commit failed'))
356 if not merge:
357 self.transplants.set(n, node)
358 else:
359 n = None
352 360 self.unlog()
353 361
354 362 return n, node
@@ -768,6 +768,22 b' test transplanting a patch turning into '
768 768 searching for changes
769 769 applying 7a7d57e15850
770 770 skipping emptied changeset 7a7d57e15850
771
772 Test empty result in --continue
773
774 $ hg transplant -s ../binarysource 1
775 searching for changes
776 applying 645035761929
777 file b already exists
778 1 out of 1 hunks FAILED -- saving rejects to file b.rej
779 patch failed to apply
780 abort: fix up the merge and run hg transplant --continue
781 [255]
782 $ hg status
783 ? b.rej
784 $ hg transplant --continue
785 645035761929 skipped due to empty diff
786
771 787 $ cd ..
772 788
773 789 Explicitly kill daemons to let the test exit on Windows
General Comments 0
You need to be logged in to leave comments. Login now