Thread (11 messages) flat view 11 messages, 3 authors, 2016-06-15

Re: [PATCH 2/4] remote-hg: fix compatibility with older versions of hg

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:55:16

On Tue, Nov 13, 2012 at 6:25 AM, Ramkumar Ramachandra
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
This patch fixes my original problem. So,
Reported-by: Ramkumar Ramachandra <redacted>
Tested-by: Ramkumar Ramachandra <redacted>

However, test 4 in test-hg.sh still fails for me:
--- expected    2012-11-13 05:22:57.946637384 +0000
+++ actual      2012-11-13 05:22:57.946637384 +0000
@@ -1,2 +1,2 @@
-zero
-refs/heads/master
+feature-a
+refs/heads/feature-a
What is going on?
Probably a bug in mercurial, but can be worked around:
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -429,10 +429,18 @@ def get_branch_tip(repo, branch):

     return heads[0]

+def get_current_bookmark(repo):
+    head = bookmarks.readcurrent(repo)
+    if not head:
+        return None
+    if repo[head] != repo['.']:
+        return None
+    return head
+
 def list_head(repo, cur):
     global g_head, bmarks

-    head = bookmarks.readcurrent(repo)
+    head = get_current_bookmark(repo)
     if head:
         node = repo[head]
     else:
-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help