changeset 22218:b629397ca15f

debugobsolete: use the new date argument on obsstore.create Now that we have this new argument, we can just use it.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 13 Aug 2014 23:25:07 -0700
parents 570f87422f54
children 79c686267486
files mercurial/commands.py
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Aug 13 22:44:47 2014 -0700
+++ b/mercurial/commands.py	Wed Aug 13 23:25:07 2014 -0700
@@ -2331,8 +2331,6 @@
 
     if precursor is not None:
         metadata = {}
-        if 'date' in opts:
-            metadata['date'] = opts['date']
         metadata['user'] = opts['user'] or ui.username()
         succs = tuple(parsenodeid(succ) for succ in successors)
         l = repo.lock()
@@ -2340,8 +2338,14 @@
             tr = repo.transaction('debugobsolete')
             try:
                 try:
+                    date = opts.get('date')
+                    if date:
+                        date = util.parsedate(date)
+                    else:
+                        date = None
                     repo.obsstore.create(tr, parsenodeid(precursor), succs,
-                                         opts['flags'], metadata=metadata)
+                                         opts['flags'], date=date,
+                                         metadata=metadata)
                     tr.close()
                 except ValueError, exc:
                     raise util.Abort(_('bad obsmarker input: %s') % exc)