status: rename {copy} to {source} for compatibility with {file_copies} (BC)
authorYuya Nishihara <yuya@tcha.org>
Sun, 05 Aug 2018 16:51:25 +0900
changeset 39370 46f3ff64bea7
parent 39369 34ba47117164
child 39371 3cd977d5a16b
status: rename {copy} to {source} for compatibility with {file_copies} (BC) .. bc:: ``{copy}`` in status command template is renamed to ``{source}``.
mercurial/commands.py
mercurial/templates/map-cmdline.default
tests/test-status.t
--- a/mercurial/commands.py	Sun Aug 05 16:44:16 2018 +0900
+++ b/mercurial/commands.py	Sun Aug 05 16:51:25 2018 +0900
@@ -5191,7 +5191,7 @@
                 fm.condwrite(showchar, 'status', '%s ', char, label=label)
                 fm.plain(fmt % repo.pathto(f, cwd), label=label)
                 if f in copy:
-                    fm.data(copy=copy[f])
+                    fm.data(source=copy[f])
                     fm.plain(('  %s' + end) % repo.pathto(copy[f], cwd),
                              label='status.copied')
 
--- a/mercurial/templates/map-cmdline.default	Sun Aug 05 16:44:16 2018 +0900
+++ b/mercurial/templates/map-cmdline.default	Sun Aug 05 16:51:25 2018 +0900
@@ -74,7 +74,7 @@
                                 {label('ui.note log.description',
                                        '{desc|strip}')}\n\n")}'
 
-status = '{status} {path|relpath}\n{if(copy, "  {copy|relpath}\n")}'
+status = '{status} {path|relpath}\n{if(source, "  {source|relpath}\n")}'
 
 # Obsfate templates, it would be removed once we introduce the obsfate
 # template fragment
--- a/tests/test-status.t	Sun Aug 05 16:44:16 2018 +0900
+++ b/tests/test-status.t	Sun Aug 05 16:51:25 2018 +0900
@@ -239,8 +239,8 @@
     "status": "A"
    },
    {
-    "copy": "modified",
     "path": "copied",
+    "source": "modified",
     "status": "A"
    },
    {
@@ -282,7 +282,7 @@
 
 Test templater support:
 
-  $ hg status -AT "[{status}]\t{if(copy, '{copy} -> ')}{path}\n"
+  $ hg status -AT "[{status}]\t{if(source, '{source} -> ')}{path}\n"
   [M]	.hgignore
   [A]	added
   [A]	modified -> copied