Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commit.py @ 45259:4eb6466e6889
commitctx: no longer use the `writecopiesto` variable in the function
The `writefilecopymeta` variable already carry the same information, so we can
use `writefilecopymeta` in the one conditional where `writecopiesto` was used.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 23 Jul 2020 21:03:30 +0200 |
parents | f0d4d1343cb4 |
children | ada51c1b6916 |
comparison
equal
deleted
inserted
replaced
45258:f0d4d1343cb4 | 45259:4eb6466e6889 |
---|---|
45 user = ctx.user() | 45 user = ctx.user() |
46 | 46 |
47 if repo.filecopiesmode == b'changeset-sidedata': | 47 if repo.filecopiesmode == b'changeset-sidedata': |
48 writechangesetcopy = True | 48 writechangesetcopy = True |
49 writefilecopymeta = True | 49 writefilecopymeta = True |
50 writecopiesto = None | |
51 else: | 50 else: |
52 writecopiesto = repo.ui.config(b'experimental', b'copies.write-to') | 51 writecopiesto = repo.ui.config(b'experimental', b'copies.write-to') |
53 writefilecopymeta = writecopiesto != b'changeset-only' | 52 writefilecopymeta = writecopiesto != b'changeset-only' |
54 writechangesetcopy = writecopiesto in ( | 53 writechangesetcopy = writecopiesto in ( |
55 b'changeset-only', | 54 b'changeset-only', |
132 filesremoved = removed | 131 filesremoved = removed |
133 | 132 |
134 files = touched | 133 files = touched |
135 mn = _commit_manifest(tr, linkrev, ctx, mctx, files, added, drop) | 134 mn = _commit_manifest(tr, linkrev, ctx, mctx, files, added, drop) |
136 | 135 |
137 if writecopiesto == b'changeset-only': | 136 if not writefilecopymeta: |
138 # If writing only to changeset extras, use None to indicate that | 137 # If writing only to changeset extras, use None to indicate that |
139 # no entry should be written. If writing to both, write an empty | 138 # no entry should be written. If writing to both, write an empty |
140 # entry to prevent the reader from falling back to reading | 139 # entry to prevent the reader from falling back to reading |
141 # filelogs. | 140 # filelogs. |
142 p1copies = p1copies or None | 141 p1copies = p1copies or None |