D6075: [RFC] transplant: append log to commit message before running filter

Kwan (Ian Moody) phabricator at mercurial-scm.org
Tue Mar 5 06:35:32 EST 2019


Kwan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Currently if a user wants to alter the "(transplanted from <hash>)" line in the
  commit message, for instance by prepending a repo URL to the hash, they have to
  do so manually via -e since the message is passed to the --filter provided
  command before the line is appended.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/transplant.py

CHANGE DETAILS

diff --git a/hgext/transplant.py b/hgext/transplant.py
--- a/hgext/transplant.py
+++ b/hgext/transplant.py
@@ -293,13 +293,13 @@
         (manifest, user, (time, timezone), files, message) = cl[:5]
         date = "%d %d" % (time, timezone)
         extra = {'transplant_source': node}
-        if filter:
-            (user, date, message) = self.filter(filter, node, cl, patchfile)
-
         if log:
             # we don't translate messages inserted into commits
             message += '\n(transplanted from %s)' % nodemod.hex(node)
 
+        if filter:
+            (user, date, message) = self.filter(filter, node, cl, patchfile)
+
         self.ui.status(_('applying %s\n') % nodemod.short(node))
         self.ui.note('%s %s\n%s\n' % (user, date, message))
 



To: Kwan, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list