Giter Club home page Giter Club logo

Comments (4)

fingolfin avatar fingolfin commented on August 25, 2024

(Disclaimer: I am not the author of this code, just somebody who tries to help. Take everything I say with a grain of salt)

Hm, looking at the mercurial source code, the + after the sha1 indicates that head in that case is either a workingctx or a memctx. My guess is on the former, but to be sure, could you add log(repr(head)) ?

Also, your repo has 1797 commits -- I wonder if 10cf14cad52b is the tip commit, resp. commit 1797?

Overall, one guess would be that the tip or working dir or so of the repository you are cloning in is not "clean". E.g. my very first idea was that perhaps there is an incomplete merge going on there (i.e. somebody forgot to "hg commit" after doing "hg merge"). But in a quick test, I couldn't replicate your error this way, though perhaps I just did not try hard enough. But perhaps you can inspect your hg repo a bit closer to see if that is the case?

from git.

felipec avatar felipec commented on August 25, 2024

Perhaps you can try this:

--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -297,7 +297,7 @@ def export_ref(repo, name, kind, head):
     tip = marks.get_tip(ename)

     # mercurial takes too much time checking this
-    if tip and tip == head.rev():
+    if tip and tip == head.rev() or not head.rev():
         # nothing to do
         return
     revs = xrange(tip, head.rev() + 1)

from git.

felipec avatar felipec commented on August 25, 2024

Also, you should probably log the name of the branch as well, so that you can check which is the desired tip of that branch.

from git.

felipec avatar felipec commented on August 25, 2024

I found the culprit, this script reproduces the issue:

(
hg init hgrepo &&
cd hgrepo &&

echo one >> content &&
hg add content &&
hg commit -m one &&

hg branch "foo bar" &&

echo two >> content &&
hg commit -m two &&

hg update default
) &&

git clone "hg::$PWD/hgrepo" gitrepo

So yeah, it was the working directory, because repo[None] returns that, and because the branch "foo" couldn't be found, and so the tip was determined to be None.

But it's already fixed:
82dec9b

from git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.