push: fix bug in detection of remote obsolete support
Current code check obsolete availability in local repo.
--- a/mercurial/localrepo.py Wed Jul 11 18:22:07 2012 +0200
+++ b/mercurial/localrepo.py Thu Jul 12 03:03:19 2012 +0200
@@ -1839,7 +1839,8 @@
if not r:
self.ui.warn(_('updating %s to public failed!\n')
% newremotehead)
- if 'obsolete' in self.listkeys('namespaces') and self.obsstore:
+ if ('obsolete' in remote.listkeys('namespaces')
+ and self.obsstore):
data = self.listkeys('obsolete')['dump']
r = remote.pushkey('obsolete', 'dump', '', data)
if not r:
--- a/tests/test-hook.t Wed Jul 11 18:22:07 2012 +0200
+++ b/tests/test-hook.t Thu Jul 12 03:03:19 2012 +0200
@@ -214,6 +214,7 @@
searching for changes
no changes found
listkeys hook: HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'}
+ listkeys hook: HG_NAMESPACE=namespaces HG_VALUES={'bookmarks': '', 'namespaces': '', 'obsolete': '', 'phases': ''}
listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
exporting bookmark baz