##// END OF EJS Templates
copies: add config option for writing copy metadata to file and/or changset...
copies: add config option for writing copy metadata to file and/or changset This introduces a config option that lets you choose to write copy metadata to the changeset extras instead of to filelog. There's also an option to write it to both places. I imagine that may possibly be useful when transitioning an existing repo. The copy metadata is stored as two fields in extras: one for copies since p1 and one for copies since p2. I may need to add more information later in order to make copy tracing faster. Specifically, I'm thinking out recording which files were added or removed so that copies._chaincopies() doesn't have to look at the manifest for that. But that would just be an optimization and that can be added once we know if it's necessary. I have also considered saving space by using replacing the destination file path by an index into the "files" list, but that can also be changed later (but before the feature is ready to release). Differential Revision: https://phab.mercurial-scm.org/D6183

File last commit:

r37137:d4a2e0d5 default
r42317:0e41f40b default
Show More
test-config-env.py
54 lines | 1.3 KiB | text/x-python | PythonLexer
/ tests / test-config-env.py
Jun Wu
rcutil: let environ override system configs (BC)...
r31685 # Test the config layer generated by environment variables
from __future__ import absolute_import, print_function
import os
from mercurial import (
encoding,
rcutil,
ui as uimod,
Matt Harbison
tests: print Unix style paths in *.py tests...
r31857 util,
Jun Wu
rcutil: let environ override system configs (BC)...
r31685 )
Yuya Nishihara
procutil: bulk-replace util.std* to point to new module
r37137 from mercurial.utils import (
procutil,
)
Yuya Nishihara
py3: byte-stringify test-config.t and test-config-env.py
r36748 testtmp = encoding.environ[b'TESTTMP']
Jun Wu
rcutil: let environ override system configs (BC)...
r31685
# prepare hgrc files
def join(name):
return os.path.join(testtmp, name)
Yuya Nishihara
py3: byte-stringify test-config.t and test-config-env.py
r36748 with open(join(b'sysrc'), 'wb') as f:
f.write(b'[ui]\neditor=e0\n[pager]\npager=p0\n')
Jun Wu
rcutil: let environ override system configs (BC)...
r31685
Yuya Nishihara
py3: byte-stringify test-config.t and test-config-env.py
r36748 with open(join(b'userrc'), 'wb') as f:
f.write(b'[ui]\neditor=e1')
Jun Wu
rcutil: let environ override system configs (BC)...
r31685
# replace rcpath functions so they point to the files above
def systemrcpath():
Yuya Nishihara
py3: byte-stringify test-config.t and test-config-env.py
r36748 return [join(b'sysrc')]
Jun Wu
rcutil: let environ override system configs (BC)...
r31685
def userrcpath():
Yuya Nishihara
py3: byte-stringify test-config.t and test-config-env.py
r36748 return [join(b'userrc')]
Jun Wu
rcutil: let environ override system configs (BC)...
r31685
rcutil.systemrcpath = systemrcpath
rcutil.userrcpath = userrcpath
os.path.isdir = lambda x: False # hack: do not load default.d/*.rc
# utility to print configs
def printconfigs(env):
encoding.environ = env
rcutil._rccomponents = None # reset cache
ui = uimod.ui.load()
for section, name, value in ui.walkconfig():
source = ui.configsource(section, name)
Yuya Nishihara
procutil: bulk-replace util.std* to point to new module
r37137 procutil.stdout.write(b'%s.%s=%s # %s\n'
% (section, name, value, util.pconvert(source)))
procutil.stdout.write(b'\n')
Jun Wu
rcutil: let environ override system configs (BC)...
r31685
# environment variable overrides
printconfigs({})
Yuya Nishihara
py3: byte-stringify test-config.t and test-config-env.py
r36748 printconfigs({b'EDITOR': b'e2', b'PAGER': b'p2'})