D6752: copies: remove existing copy info from the changeset on amend (BC)
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Thu Sep 5 19:15:58 UTC 2019
Closed by commit rHG57ea0a81a65c: copies: remove existing copy info from the changeset on amend (BC) (authored by martinvonz).
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/D6752?vs=16285&id=16381
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D6752/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D6752
AFFECTED FILES
mercurial/changelog.py
tests/test-copies-in-changeset.t
CHANGE DETAILS
diff --git a/tests/test-copies-in-changeset.t b/tests/test-copies-in-changeset.t
--- a/tests/test-copies-in-changeset.t
+++ b/tests/test-copies-in-changeset.t
@@ -140,11 +140,7 @@
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/dd7bb9581359-a6e6b6d2-amend.hg
$ hg changesetcopies
files: j
- filesadded: 0
- filesremoved:
- p1copies: 0\x00a (esc)
- p2copies:
$ hg showcopies --config experimental.copies.read-from=filelog-only
a -> j
The entries should be written to extras even if they're empty (so the client
diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -637,6 +637,9 @@
if extra is None and any(x is not None for x in extrasentries):
extra = {}
sortedfiles = sorted(files)
+ if extra is not None:
+ for name in ('p1copies', 'p2copies', 'filesadded', 'filesremoved'):
+ extra.pop(name, None)
if p1copies is not None:
extra['p1copies'] = encodecopies(sortedfiles, p1copies)
if p2copies is not None:
To: martinvonz, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list