diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -405,7 +405,7 @@ class localrepository(object): # 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 diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -73,6 +73,7 @@ Killing a single changeset with itself s $ cd .. Killing a single changeset with replacement +(and testing the format option) $ hg init tmpb $ cd tmpb @@ -84,7 +85,7 @@ Killing a single changeset with replacem $ 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 @@ Killing a single changeset with replacem $ 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 '.^'