[PATCH 4 of 5] status: rename {copy} to {source} for compatibility with {file_copies} (BC)

Yuya Nishihara yuya at tcha.org
Thu Aug 30 09:09:49 EDT 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1533455485 -32400
#      Sun Aug 05 16:51:25 2018 +0900
# Node ID ac97d9eb599ae018b73338cbfa2cd2062221b20d
# Parent  1fd4bcc235cd6c3615a1fe398d4df23fcc60d43e
status: rename {copy} to {source} for compatibility with {file_copies} (BC)

.. bc::

   ``{copy}`` in status command template is renamed to ``{source}``.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5191,7 +5191,7 @@ def status(ui, repo, *pats, **opts):
                 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')
 
diff --git a/mercurial/templates/map-cmdline.default b/mercurial/templates/map-cmdline.default
--- a/mercurial/templates/map-cmdline.default
+++ b/mercurial/templates/map-cmdline.default
@@ -74,7 +74,7 @@ description = '{if(desc|strip, "{label('
                                 {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
diff --git a/tests/test-status.t b/tests/test-status.t
--- a/tests/test-status.t
+++ b/tests/test-status.t
@@ -239,8 +239,8 @@ hg status -A:
     "status": "A"
    },
    {
-    "copy": "modified",
     "path": "copied",
+    "source": "modified",
     "status": "A"
    },
    {
@@ -282,7 +282,7 @@ hg status -A:
 
 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


More information about the Mercurial-devel mailing list