Typo in .hgsub renders revisions un-checkout-able

paul_nathan at selinc.com paul_nathan at selinc.com
Wed Nov 21 11:58:49 CST 2012


This is generally true for hg subrepos as well, in my experience.  Usually 
I've had to fart around pretty hard to get anything working again. As I 
recall, the best way to solve it is to `hg up -r null`,  `rm .hgsub` and 
then update to a consistent .hgsub revision.   N.b., this was part of the 
motivation for guestrepos.

I'd love it if this was solvable in a more user-friendly way.

- - -
Regards,
Paul Nathan



From:   Greg Ward <greg at gerg.ca>
To:     mercurial-devel at selenic.com, 
Date:   11/21/2012 09:11 AM
Subject:        Typo in .hgsub renders revisions un-checkout-able
Sent by:        mercurial-devel-bounces at selenic.com



Hi all --

I'm using git subrepos, and yesterday I made a mistake adding a new
subrepo. See if you can spot the typo:

  --- a/.hgsub
  +++ b/.hgsub
  @@ -2,3 +2,4 @@
   src/github.com/cznic/golex  = [git]git://github.com/cznic/golex
   src/github.com/cznic/lexer  = [git]git://github.com/cznic/lexer
   src/github.com/cznic/lex    = [git]git://github.com/cznic/lex
  +src/github.com/stretchrcom/testify = 
[git]:git://github.com/stretchrcom/testify

Yep, an extra colon snuck in right after "[git]". Oops, my mistake.
100% user error and I'll fix it as soon as I can.

Unfortunately, the changeset resulting from this commit cannot be
checked out:

  $ hg up 73
  cloning subrepo src/github.com/stretchrcom/testify from 
ssh://lucifer/src/fubsy/:git:/github.com/stretchrcom/testify
  fatal: '/src/fubsy/:git:/github.com/stretchrcom/testify' does not appear 
to be a git repository
  fatal: The remote end hung up unexpectedly
  abort: git clone error 128 in src/github.com/stretchrcom/testify

"ssh://lucifer/src/fubsy" is paths.default in my container repo, so I
guess the stray colon causes URL parsing confusion -- the resulting
URL makes no sense to git, so no wonder it fails.

On reflection, I'm guessing that *any* error in the URL for a git
subrepo could cause this problem. This seems like a serious usability
problem. You should not be able to commit a changeset that you cannot
update to later. Probably instead of an abort, you should get a big
noisy warning like

  failed to clone git subrepo: your working directory is inconsistent!
  (maybe you need to fix .hgsub so git clone works?)

Thoughts?

       Greg
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel at selenic.com
http://selenic.com/mailman/listinfo/mercurial-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121121/5a31d16f/attachment.html>


More information about the Mercurial-devel mailing list