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

login
register
mail settings
Submitter phabricator
Date March 5, 2019, 11:35 a.m.
Message ID <differential-rev-PHID-DREV-dpn2jltxuyeygpzt7nj5-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39060/
State Superseded
Headers show

Comments

phabricator - March 5, 2019, 11:35 a.m.
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




To: Kwan, #hg-reviewers
Cc: mercurial-devel
phabricator - March 6, 2019, 1:08 p.m.
Kwan abandoned this revision.
Kwan added a comment.


  Urgh, never mind, just realised I missed the existence of HGREVISION in the documentation.

REPOSITORY
  rHG Mercurial

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

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

Patch

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))