[Updated] D10707: templates: fix `revset('parents()') % ...` in amend message template

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sat May 15 23:23:21 UTC 2021


Closed by commit rHGb338d831d18c: templates: fix `revset('parents()') % ...` in amend message template (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10707?vs=27908&id=27928

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10707/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D10707

AFFECTED FILES
  mercurial/context.py
  tests/test-commit-amend.t

CHANGE DETAILS

diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -957,6 +957,7 @@
   $ cat >> .hg/hgrc <<EOF
   > [committemplate]
   > changeset.commit.amend = {desc}\n
+  >     HG: {revset('parents()') % 'parent: {desc|firstline}\n'}
   >     HG: M: {file_mods}
   >     HG: A: {file_adds}
   >     HG: R: {file_dels}
@@ -971,6 +972,8 @@
   $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo"
   expecting diff of foo
   
+  HG: parent: editor should be suppressed
+  
   HG: M: 
   HG: A: foo
   HG: R: 
@@ -985,6 +988,8 @@
   $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo and y"
   expecting diff of foo and y
   
+  HG: parent: expecting diff of foo
+  
   HG: M: 
   HG: A: foo y
   HG: R: 
@@ -1003,6 +1008,8 @@
   $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo and y"
   expecting diff of a, foo and y
   
+  HG: parent: expecting diff of foo and y
+  
   HG: M: 
   HG: A: foo y
   HG: R: a
@@ -1027,6 +1034,8 @@
   $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo, x and y"
   expecting diff of a, foo, x and y
   
+  HG: parent: expecting diff of a, foo and y
+  
   HG: M: 
   HG: A: foo y
   HG: R: a x
@@ -1058,6 +1067,8 @@
   $ HGEDITOR=cat hg commit --amend -e -m "cc should be excluded" -X cc
   cc should be excluded
   
+  HG: parent: expecting diff of a, foo, x and y
+  
   HG: M: 
   HG: A: foo y
   HG: R: a x
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1392,6 +1392,9 @@
     def __bytes__(self):
         return bytes(self._parents[0]) + b"+"
 
+    def hex(self):
+        self._repo.nodeconstants.wdirhex
+
     __str__ = encoding.strmethod(__bytes__)
 
     def __nonzero__(self):



To: martinvonz, #hg-reviewers, joerg.sonnenberger, pulkit
Cc: joerg.sonnenberger, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210515/7429b7bb/attachment-0002.html>


More information about the Mercurial-patches mailing list