hgext/rebase.py
branchstable
changeset 21826 2ba6c9b4e0eb
parent 21210 799c494189a9
child 21832 4b93e19cd6e6
--- a/hgext/rebase.py	Sat Jun 07 15:14:36 2014 -0400
+++ b/hgext/rebase.py	Sat Jun 07 15:23:12 2014 -0400
@@ -345,7 +345,16 @@
                                   'resolve, then hg rebase --continue)'))
                     finally:
                         ui.setconfig('ui', 'forcemerge', '', 'rebase')
-                cmdutil.duplicatecopies(repo, rev, target)
+                if collapsef:
+                    cmdutil.duplicatecopies(repo, rev, target)
+                else:
+                    # If we're not using --collapse, we need to
+                    # duplicate copies between the revision we're
+                    # rebasing and its first parent, but *not*
+                    # duplicate any copies that have already been
+                    # performed in the destination.
+                    p1rev = repo[rev].p1().rev()
+                    cmdutil.duplicatecopies(repo, rev, p1rev, skiprev=target)
                 if not collapsef:
                     newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn,
                                           editor=editor)