Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 45445:766797f23f77
debugmergestate: show extras for files which are not in mergestate
With recent changes and future changes, we will like to store extras information
about files which were merged automatically. Hence, we will have merge extras
for files which are not in the mergestate.
Differential Revision: https://phab.mercurial-scm.org/D8942
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 24 Aug 2020 18:59:19 +0530 |
parents | 4aa484efc926 |
children | 00e4e97c6bc8 |
comparison
equal
deleted
inserted
replaced
45444:f6c67bb4ca03 | 45445:766797f23f77 |
---|---|
2014 b' rename side: {rename_side}\n' | 2014 b' rename side: {rename_side}\n' |
2015 b' renamed path: {renamed_path}\n' | 2015 b' renamed path: {renamed_path}\n' |
2016 b'")}' | 2016 b'")}' |
2017 b'{extras % " extra: {key} = {value}\n"}' | 2017 b'{extras % " extra: {key} = {value}\n"}' |
2018 b'"}' | 2018 b'"}' |
2019 b'{extras % "extra: {file} ({key} = {value})\n"}' | |
2019 ) | 2020 ) |
2020 | 2021 |
2021 ms = mergestatemod.mergestate.read(repo) | 2022 ms = mergestatemod.mergestate.read(repo) |
2022 | 2023 |
2023 fm = ui.formatter(b'debugmergestate', opts) | 2024 fm = ui.formatter(b'debugmergestate', opts) |
2066 fm_extras.data(key=k) | 2067 fm_extras.data(key=k) |
2067 fm_extras.data(value=v) | 2068 fm_extras.data(value=v) |
2068 fm_extras.end() | 2069 fm_extras.end() |
2069 | 2070 |
2070 fm_files.end() | 2071 fm_files.end() |
2072 | |
2073 fm_extras = fm.nested(b'extras') | |
2074 for f, d in sorted(pycompat.iteritems(ms._stateextras)): | |
2075 if f in ms: | |
2076 # If file is in mergestate, we have already processed it's extras | |
2077 continue | |
2078 for k, v in pycompat.iteritems(d): | |
2079 fm_extras.startitem() | |
2080 fm_extras.data(file=f) | |
2081 fm_extras.data(key=k) | |
2082 fm_extras.data(value=v) | |
2083 fm_extras.end() | |
2071 | 2084 |
2072 fm.end() | 2085 fm.end() |
2073 | 2086 |
2074 | 2087 |
2075 @command(b'debugnamecomplete', [], _(b'NAME...')) | 2088 @command(b'debugnamecomplete', [], _(b'NAME...')) |