# HG changeset patch # User Martin von Zweigbergk # Date 1562023551 25200 # Node ID e3df1e15bee9d70d6cc4697e503091a7bff0f8fc # Parent 4cafbd3b50c6dda7715a3458b5d938b5e9a01230 changelog: fix handling of empty copy entries in changeset Before this patch, when an empty value was found in the changeset, we would get a ValueError, which would result in None being returned for addedfiles/removedfiles and p1copies/p2copies. That made 278dcb24e535 (copies: write empty entries in changeset when also writing to filelog, 2019-04-23) ineffective at helping the read path not look for copies in the filelogs. Differential Revision: https://phab.mercurial-scm.org/D6595 diff -r 4cafbd3b50c6 -r e3df1e15bee9 mercurial/changelog.py --- a/mercurial/changelog.py Sun Jun 30 17:52:57 2019 +0530 +++ b/mercurial/changelog.py Mon Jul 01 16:25:51 2019 -0700 @@ -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):