3190: Cannot checkout rbtools repository using Mercurial

dchris*******@zimbr***** (Google Code) (Is this you? Claim this profile.)
April 23, 2014
SUMMARY

The Git repository for rbtools currently contains a Mercurial repository, with its ‘.hg’ directory and all. This makes any Mercurial conversion unusable, as Mercurial cannot handle one repository checked into another.

I would recommend either backing out dd528e0 or at least fixing it so that it didn't contain a ‘.hg’ directory. Alternatives include scripting repository creation, storing a bundle in the repository or fake something equivalent to Git's bare repositories and move the files into place when running the test suite.

You could well argue that Mercurial and/or hg-git should disallow this behaviour, but I suspect no-one has wanted to this before…

STEPS TO REPRODUCE

1) Install Mercurial & hg-git
2) Clone the rbtools using Mercurial

EXPECTED RESULTS

Repository clones; update succeeds and I get what's equivalent to the master branch in Git.

ACTUAL RESULTS

Repository clones; update fails as Mercurial _really_ doesn't like repositories containing other repositories. Conceptually, it just doesn't make sense.

$ hg clone git://github.com/reviewboard/rbtools.git
destination directory: rbtools
importing git objects into hg
updating to branch default                                                                                                                                                                                    
abort: path 'rbtools/clients/testdata/hg-repo/.hg/00changelog.i' is inside nested repo 'rbtools/clients/testdata/hg-repo'
david
#1 david
This is something that we're really pretty unlikely to fix. Bundles don't work the same as full repositories, and so some of our tests wouldn't work. Scripting the repository creation is how things used to work, but it adds a non-trivial execution time to every single mercurial-related test, and the rbtools test suite takes long enough to run already that it's hard to justify the cost against an unusual developer workflow.
#2 dchris*******@zimbr***** (Google Code) (Is this you? Claim this profile.)
If I come up with a patch to fix this, would you accept it? I could either make it extract the repository once per test run, or simply stash the Git and Mercurial repositories in a tarball.
chipx86
#3 chipx86
Possibly, but it does make development more painful for us.

I'd like a better sense for why you're choosing to wrap it with Mercurial. I get that there's a preference for Mercurial. What kind of work are you doing? Are you expecting to contribute back to the codebase? RBTools isn't going to work so well with that I'd imagine.
  • +NeedInfo
#4 dchris*******@zimbr***** (Google Code) (Is this you? Claim this profile.)
Well, I've been looking into making it work with Mercurial and Perfarce, a Perforce integration extension for Mercurial, but with no luck so far. Essentially, I just use Mercurial to track the RBTools repository, but I'd like the option to modify something, without using a tool I find really cumbersome to use.
chipx86
#5 chipx86
Perforce would be good. Right now, there's a lot of work going on with Mercurial support, so it's basically getting a complete overhaul. This work is all happening on the master branch, and a series of changes are up for review on https://reviews.reviewboard.org/.

You're still going to have issues posting a change to our Review Board if you wrap with Mercurial, though. RBTools doesn't support converting that to Git and matching it with Review Board.
#6 dchris*******@zimbr***** (Google Code) (Is this you? Claim this profile.)
Well, I can always push from Mercurial to Git and post the review from there… (Adding support for hg-git would be neat, but I haven't need it yet.)

I just tried to a minor change which stashes the repository in a tarball and extracts it in the setUp routine. The change is rather small and appears to have no discernible performance impact; would you be interested?
#7 dchris*******@zimbr***** (Google Code) (Is this you? Claim this profile.)
Here's an example patch: https://reviews.reviewboard.org/r/5257/
david
#8 david
  • -NeedInfo
    +New
  • -Priority-Medium
    +Priority-Low
david
#9 david
  • -New
    +WontFix