# HG changeset patch # User Stanislau Hlebik # Date 2015-10-26 09:22:26 # Node ID a2aa39a725a1c697a84100507fe986e8364e097e # Parent ad443e8d9334687ed004b363b701ca320a19e829 rebase: add date parameter to concludenode function This parameter will allow us to set the date of rebased commits diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -586,7 +586,7 @@ def externalparent(repo, state, targetan ', '.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 @@ def concludenode(repo, rev, p1, p2, comm 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)