##// 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 '''recover last transaction and apply remaining changesets'''
301 '''recover last transaction and apply remaining changesets'''
302 if os.path.exists(os.path.join(self.path, 'journal')):
302 if os.path.exists(os.path.join(self.path, 'journal')):
303 n, node = self.recover(repo, source, opts)
303 n, node = self.recover(repo, source, opts)
304 self.ui.status(_('%s transplanted as %s\n') % (short(node),
304 if n:
305 short(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 seriespath = os.path.join(self.path, 'series')
310 seriespath = os.path.join(self.path, 'series')
307 if not os.path.exists(seriespath):
311 if not os.path.exists(seriespath):
308 self.transplants.write()
312 self.transplants.write()
@@ -343,12 +347,16 b' class transplanter(object):'
343 revlog.hex(parent))
347 revlog.hex(parent))
344 if merge:
348 if merge:
345 repo.setparents(p1, parents[1])
349 repo.setparents(p1, parents[1])
346 n = repo.commit(message, user, date, extra=extra,
350 modified, added, removed, deleted = repo.status()[:4]
347 editor=self.getcommiteditor())
351 if merge or modified or added or removed or deleted:
348 if not n:
352 n = repo.commit(message, user, date, extra=extra,
349 raise util.Abort(_('commit failed'))
353 editor=self.getcommiteditor())
350 if not merge:
354 if not n:
351 self.transplants.set(n, node)
355 raise util.Abort(_('commit failed'))
356 if not merge:
357 self.transplants.set(n, node)
358 else:
359 n = None
352 self.unlog()
360 self.unlog()
353
361
354 return n, node
362 return n, node
@@ -768,6 +768,22 b' test transplanting a patch turning into '
768 searching for changes
768 searching for changes
769 applying 7a7d57e15850
769 applying 7a7d57e15850
770 skipping emptied changeset 7a7d57e15850
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 $ cd ..
787 $ cd ..
772
788
773 Explicitly kill daemons to let the test exit on Windows
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