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