Patchwork D6937: copies: move file input processsing early

login
register
mail settings
Submitter phabricator
Date Oct. 1, 2019, 5:08 p.m.
Message ID <4de50036a74711bf15bcb574189b67d2@localhost.localdomain>
Download mbox | patch
Permalink /patch/41906/
State Not Applicable
Headers show

Comments

phabricator - Oct. 1, 2019, 5:08 p.m.
Closed by commit rHG041f042afcc5: copies: move file input processsing early (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6937?vs=16734&id=16756

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6937/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6937

AFFECTED FILES
  mercurial/changelog.py

CHANGE DETAILS




To: marmoute, martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -638,18 +638,26 @@ 
         if extra is not None:
             for name in ('p1copies', 'p2copies', 'filesadded', 'filesremoved'):
                 extra.pop(name, None)
+        if p1copies is not None:
+            p1copies = encodecopies(sortedfiles, p1copies)
+        if p2copies is not None:
+            p2copies = encodecopies(sortedfiles, p2copies)
+        if filesadded is not None:
+            filesadded = encodefileindices(sortedfiles, filesadded)
+        if filesremoved is not None:
+            filesremoved = encodefileindices(sortedfiles, filesremoved)
         if self._copiesstorage == 'extra':
             extrasentries = p1copies, p2copies, filesadded, filesremoved
             if extra is None and any(x is not None for x in extrasentries):
                 extra = {}
             if p1copies is not None:
-                extra['p1copies'] = encodecopies(sortedfiles, p1copies)
+                extra['p1copies'] = p1copies
             if p2copies is not None:
-                extra['p2copies'] = encodecopies(sortedfiles, p2copies)
+                extra['p2copies'] = p2copies
             if filesadded is not None:
-                extra['filesadded'] = encodefileindices(sortedfiles, filesadded)
+                extra['filesadded'] = filesadded
             if filesremoved is not None:
-                extra['filesremoved'] = encodefileindices(sortedfiles, filesremoved)
+                extra['filesremoved'] = filesremoved
 
         if extra:
             extra = encodeextra(extra)