Patchwork [1,of,3] rebase: add date parameter to concludenode function

login
register
mail settings
Submitter Stanislau Hlebik
Date Nov. 3, 2015, 6:52 p.m.
Message ID <bb57790670b9c756e855.1446576734@devvm201.lla1.facebook.com>
Download mbox | patch
Permalink /patch/11277/
State Accepted
Headers show

Comments

Stanislau Hlebik - Nov. 3, 2015, 6:52 p.m.
# HG changeset patch
# User Stanislau Hlebik <stash@fb.com>
# Date 1445851346 25200
#      Mon Oct 26 02:22:26 2015 -0700
# Node ID bb57790670b9c756e8559250fd9c782b8eaa7df5
# Parent  cbd04ce641b943ee40b2355b81fc910a7c7a4a88
rebase: add date parameter to concludenode function

This parameter will allow us to set the date of rebased commits

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -586,7 +586,7 @@ 
                       ', '.join(str(p) for p in sorted(parents))))
 
 def concludenode(repo, rev, p1, p2, commitmsg=None, editor=None, extrafn=None,
-                 keepbranches=False):
+                 keepbranches=False, date=None):
     '''Commit the wd changes with parents p1 and p2. Reuse commit info from rev
     but also store useful information in extra.
     Return node of committed revision.'''
@@ -608,8 +608,10 @@ 
             if keepbranch:
                 repo.ui.setconfig('ui', 'allowemptycommit', True)
             # Commit might fail if unresolved files exist
+            if date is None:
+                date = ctx.date()
             newnode = repo.commit(text=commitmsg, user=ctx.user(),
-                                  date=ctx.date(), extra=extra, editor=editor)
+                                  date=date, extra=extra, editor=editor)
         finally:
             repo.ui.restoreconfig(backup)