git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 13, 2012, 07:11 UTC
Message-ID
<CAMP44s3GQOVUGOMsz=U5zbecsHybejjH-KLgmbmJsbnzFzC+qg@mail.gmail.com>
In-Reply-To
<CALkWK0k9Ta-SOo43Knz9kMV0ePKf7wjK-3Zm6ocDQpe7VzFz+A@mail.gmail.com>

On Tue, Nov 13, 2012 at 6:25 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:

Show 15 quoted lines
> This patch fixes my original problem. So,
> Reported-by: Ramkumar Ramachandra <artagnon@gmail.com>
> Tested-by: Ramkumar Ramachandra <artagnon@gmail.com>
>
> 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
Previous: Ramkumar RamachandraNext: Felipe Contreras
Message 9 of 11 in “remote-hg: small fixes”
  1. 0/4 remote-hg: small fixesFelipe Contreras, Nov 12, 2012
  2. 1/4 remote-hg: add missing config for basic testsFelipe Contreras, Nov 12, 2012
  3. Jeff KingNov 12, 2012
  4. Felipe ContrerasNov 13, 2012
  5. Jeff KingNov 13, 2012
  6. Felipe ContrerasNov 13, 2012
  7. 2/4 remote-hg: fix compatibility with older versions of hgFelipe Contreras, Nov 12, 2012
  8. Ramkumar RamachandraNov 13, 2012
  9. Felipe ContrerasNov 13, 2012
  10. 3/4 remote-hg: try the 'tip' if no checkout presentFelipe Contreras, Nov 12, 2012
  11. 4/4 remote-hg: avoid bad refsFelipe Contreras, Nov 12, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.