Mercurial > hg-stable
changeset 23734:f4e6475950f1 stable
cmdutil.jsonchangeset: properly compute added and removed files
jsonchangeset._show() was computing the reverse status of the current
changeset. As a result, added files were showing up as removed and
removed files were showing up as adds.
There were existing tests for this code and they were flat out wrong.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 05 Jan 2015 22:18:55 -0800 |
parents | aafeaba22826 |
children | b9d06fa10ef2 c90d195320c5 |
files | mercurial/cmdutil.py tests/test-command-template.t |
diffstat | 2 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sat Jan 03 10:25:08 2015 +0900 +++ b/mercurial/cmdutil.py Mon Jan 05 22:18:55 2015 -0800 @@ -1072,7 +1072,7 @@ ", ".join('"%s": "%s"' % (j(k), j(v)) for k, v in ctx.extra().items())) - files = ctx.status(ctx.p1()) + files = ctx.p1().status(ctx) self.ui.write(',\n "modified": [%s]' % ", ".join('"%s"' % j(f) for f in files[0])) self.ui.write(',\n "added": [%s]' %
--- a/tests/test-command-template.t Sat Jan 03 10:25:08 2015 +0900 +++ b/tests/test-command-template.t Mon Jan 05 22:18:55 2015 -0800 @@ -696,8 +696,8 @@ "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64", "extra": {"branch": "default"}, "modified": [], - "added": ["second"], - "removed": ["fourth", "third"] + "added": ["fourth", "third"], + "removed": ["second"] }, { "rev": 7, @@ -713,8 +713,8 @@ "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf", "extra": {"branch": "default"}, "modified": [], - "added": [], - "removed": ["second"] + "added": ["second"], + "removed": [] }, { "rev": 6, @@ -747,8 +747,8 @@ "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216", "extra": {"branch": "default"}, "modified": [], - "added": [], - "removed": ["d"] + "added": ["d"], + "removed": [] }, { "rev": 4, @@ -798,8 +798,8 @@ "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1", "extra": {"branch": "default"}, "modified": [], - "added": [], - "removed": ["c"] + "added": ["c"], + "removed": [] }, { "rev": 1, @@ -815,8 +815,8 @@ "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55", "extra": {"branch": "default"}, "modified": [], - "added": [], - "removed": ["b"] + "added": ["b"], + "removed": [] }, { "rev": 0, @@ -832,8 +832,8 @@ "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0", "extra": {"branch": "default"}, "modified": [], - "added": [], - "removed": ["a"] + "added": ["a"], + "removed": [] } ]