changeset 22219:79c686267486

obsolete: add a date argument to the `createmarkers` function The function is now just passing the value to create markers.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 14 Aug 2014 12:59:48 -0700
parents b629397ca15f
children 908c76e84ec5
files mercurial/obsolete.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsolete.py	Wed Aug 13 23:25:07 2014 -0700
+++ b/mercurial/obsolete.py	Thu Aug 14 12:59:48 2014 -0700
@@ -832,7 +832,7 @@
     return divergent
 
 
-def createmarkers(repo, relations, flag=0, metadata=None):
+def createmarkers(repo, relations, flag=0, date=None, metadata=None):
     """Add obsolete markers between changesets in a repo
 
     <relations> must be an iterable of (<old>, (<new>, ...)[,{metadata}])
@@ -851,8 +851,6 @@
     # prepare metadata
     if metadata is None:
         metadata = {}
-    if 'date' not in metadata:
-        metadata['date'] = '%i %i' % util.makedate()
     if 'user' not in metadata:
         metadata['user'] = repo.ui.username()
     tr = repo.transaction('add-obsolescence-marker')
@@ -871,7 +869,7 @@
             nsucs = tuple(s.node() for s in sucs)
             if nprec in nsucs:
                 raise util.Abort("changeset %s cannot obsolete itself" % prec)
-            repo.obsstore.create(tr, nprec, nsucs, flag,
+            repo.obsstore.create(tr, nprec, nsucs, flag, date=date,
                                  metadata=localmetadata)
             repo.filteredrevcache.clear()
         tr.close()