[PATCH 2/8] remote-hg: update to 'public' phase when pushing
This is what Mercurial does.
Reported-by: Nathan Palmer
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
git-remote-hg.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/git-remote-hg.py b/git-remote-hg.py
index c849abb..204ceeb 100755
--- a/git-remote-hg.py
+++ b/git-remote-hg.py
@@ -995,9 +995,17 @@ def push_unsafe(repo, remote, parsed_refs, p_revs):
if unbundle:
if force:
remoteheads = ['force']
- return remote.unbundle(cg, remoteheads, 'push')
+ ret = remote.unbundle(cg, remoteheads, 'push')
else:
- return remote.addchangegroup(cg, 'push', repo.url())
+ ret = remote.addchangegroup(cg, 'push', repo.url())
+
+ phases = remote.listkeys('phases')
+ if phases:
+ for head in p_revs:
+ # update to public
+ remote.pushkey('phases', hghex(head), '1', '0')
+
+ return ret
def push(repo, remote, parsed_refs, p_revs):
if hasattr(remote, 'canpush') and not remote.canpush():
--
1.9.2+fc1.3.gade8541