changeset 26868:a2aa39a725a1

rebase: add date parameter to concludenode function This parameter will allow us to set the date of rebased commits
author Stanislau Hlebik <stash@fb.com>
date Mon, 26 Oct 2015 02:22:26 -0700
parents ad443e8d9334
children 412e8c5e38b4
files hgext/rebase.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Sat Oct 24 09:47:33 2015 +0100
+++ b/hgext/rebase.py	Mon Oct 26 02:22:26 2015 -0700
@@ -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)