obsstore: fix defaultformat option passing
authorDurham Goode <durham@fb.com>
Wed, 15 Oct 2014 12:52:10 -0700
changeset 22948 c136e26953aa
parent 22947 c63a09b6b337
child 22949 714f6ef43f3a
obsstore: fix defaultformat option passing The obsstore format passing was not actually being passed to the obsstore. This fixes it.
mercurial/localrepo.py
tests/test-obsolete.t
--- a/mercurial/localrepo.py	Wed Oct 15 15:35:59 2014 -0400
+++ b/mercurial/localrepo.py	Wed Oct 15 12:52:10 2014 -0700
@@ -405,7 +405,7 @@
         # rely on obsstore class default when possible.
         kwargs = {}
         if defaultformat is not None:
-            defaultformat['defaultformat'] = defaultformat
+            kwargs['defaultformat'] = defaultformat
         store = obsolete.obsstore(self.sopener, **kwargs)
         if store and not obsolete._enabled:
             # message is rare enough to not be translated
--- a/tests/test-obsolete.t	Wed Oct 15 15:35:59 2014 -0400
+++ b/tests/test-obsolete.t	Wed Oct 15 12:52:10 2014 -0700
@@ -73,6 +73,7 @@
   $ cd ..
 
 Killing a single changeset with replacement
+(and testing the format option)
 
   $ hg init tmpb
   $ cd tmpb
@@ -84,7 +85,7 @@
   $ mkcommit new_c
   created new head
   $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
-  $ hg debugobsolete --flag 12 `getid original_c`  `getid new_c` -d '56 120'
+  $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c`  `getid new_c` -d '56 120'
   $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
   2:245bde4270cd add original_c
   $ hg debugrevlog -cd
@@ -96,6 +97,11 @@
   $ hg debugobsolete
   245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Wed Dec 31 23:58:56 1969 -0002) {'user': 'test'}
 
+(check for version number of the obsstore)
+
+  $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null
+  \x00 (no-eol) (esc)
+
 do it again (it read the obsstore before adding new changeset)
 
   $ hg up '.^'