Patchwork D6595: changelog: fix handling of empty copy entries in changeset

login
register
mail settings
Submitter phabricator
Date July 4, 2019, 3:01 p.m.
Message ID <fec4a9ac53afb1a615f2d06202d592f5@localhost.localdomain>
Download mbox | patch
Permalink /patch/40775/
State Not Applicable
Headers show

Comments

phabricator - July 4, 2019, 3:01 p.m.
Closed by commit rHGe3df1e15bee9: changelog: fix handling of empty copy entries in changeset (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6595?vs=15736&id=15759

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

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

AFFECTED FILES
  mercurial/changelog.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -92,6 +92,8 @@ 
 def decodecopies(files, data):
     try:
         copies = {}
+        if not data:
+            return copies
         for l in data.split('\n'):
             strindex, src = l.split('\0')
             i = int(strindex)
@@ -114,6 +116,8 @@ 
 def decodefileindices(files, data):
     try:
         subset = []
+        if not data:
+            return subset
         for strindex in data.split('\n'):
             i = int(strindex)
             if i < 0 or i >= len(files):