Ticket #186 (new defect)

Opened 9 months ago

Last modified 3 months ago

mercurial checkouts should separate clone and update

Reported by: dsallings Assigned to:
Priority: major Milestone: undecided
Component: vc-support Version: 0.7.6
Keywords: mercurial Cc: dustin, bhearsum, Pike, afri, even

Description

The current vc full model uses clone -r to get a tree to a particular version. This is incorrect in the case where the target version is in a named branch. The repository history will be truncated at the correct location, but the automatic checkout will be on the default branch (as of 0.9.5).

The ideal behavior is to clone *without* a checkout, and then update to the correct revision after the clone.

The attached patch is how we're doing this. You could possibly do both (clone without checkout to a revision and then update to that revision), but I think that the difference will generally be negligible.

Attachments

mercurial-separate-clone-and-update.diff (3.7 kB) - added by dsallings on 02/14/08 23:13:46.
separate the clone and update in mercurial

Change History

02/14/08 23:13:46 changed by dsallings

  • attachment mercurial-separate-clone-and-update.diff added.

separate the clone and update in mercurial

02/17/08 09:54:40 changed by dustin

  • cc set to dustin.

I'm not very familiar with mercurial, but it looks like this patch is removing a big chunk of "fallback" functionality for older versions of hg. I'd like to hear from some other mercurial users before adopting this patch.

03/11/08 02:55:10 changed by Pike

  • cc changed from dustin to dustin, bhearsum, Pike.

Ben, can you check?

07/20/08 04:53:48 changed by afri

  • cc changed from dustin, bhearsum, Pike to dustin, bhearsum, Pike, afri.

08/25/08 11:50:16 changed by even

  • cc changed from dustin, bhearsum, Pike, afri to dustin, bhearsum, Pike, afri, even.

09/01/08 04:34:55 changed by even

That patch may fail if self.argsbranch? does not exists when calling doVCFull. You should change your if to match : if self.argsrevision?:

updatecmd.extend(['--rev', self.argsrevision?])

elif self.argsbranch?:

updatecmd.extend(['--rev', self.argsbranch?])

else

updatecmd.extend(['--rev', 'default'])

09/02/08 04:51:15 changed by even

Hmm, it seems that doing

if self.args['branch']:
  #...

is not good because branch does not exists every time. We can have errors because it does not exists. Maybe testing

if branch in self.args and self.args['branch']:
  #...

will do the trick.