test: fix test-evolve.t stable
authorBoris Feld <boris.feld@octobus.net>
Fri, 26 May 2017 15:01:21 +0200
branchstable
changeset 2481 d63f383e43b6
parent 2479 df9233aa4bac
child 2482 c0bfddf89c62
test: fix test-evolve.t Metaedit take the current date when no date is given. When we added default- date, the date ended up to be the same and the behavior changed. Fix the text by disabling default-date in the metaedit call and update the comment about what is needed to fix correctly the test; take the changeset date when metaediting only one changeset.
hgext3rd/evolve/__init__.py
tests/test-evolve.t
--- a/hgext3rd/evolve/__init__.py	Thu May 25 21:14:04 2017 +0200
+++ b/hgext3rd/evolve/__init__.py	Fri May 26 15:01:21 2017 +0200
@@ -817,7 +817,10 @@
             message = old.description()
 
         user = commitopts.get('user') or old.user()
-        date = commitopts.get('date') or None # old.date()
+        # TODO: In case not date is given, we should take the old commit date
+        # if we are working one one changeset or mimic the fold behavior about
+        # date
+        date = commitopts.get('date') or None
         extra = dict(commitopts.get('extra', old.extra()))
         extra['branch'] = head.branch()
 
--- a/tests/test-evolve.t	Thu May 25 21:14:04 2017 +0200
+++ b/tests/test-evolve.t	Fri May 26 15:01:21 2017 +0200
@@ -1586,8 +1586,11 @@
   |
   ~
 
-TODO: don't create a new commit in this case
-  $ hg metaedit --config defaults.metaedit=
+TODO: don't create a new commit in this case, we should take the date of the
+old commit (we add a default date with a value to show that metaedit is taking
+the current date to generate the hash, this way we still have a stable hash
+but highlight the bug)
+  $ hg metaedit --config defaults.metaedit= --config devel.default-date="42 0"
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg log -r '.^::.' --template '{rev}: {desc|firstline}\n'
   36: add uu