Differences between revisions 5 and 6
Revision 5 as of 2006-03-06 10:44:11
Size: 776
Editor: EricHopper
Comment:
Revision 6 as of 2007-12-14 19:53:07
Size: 1509
Comment:
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:

Comments from Matt Mackall:

> > How hard would this be to implement?

On a scale of 1 to 10, I'd rate it about a 7.

The simplest approach is probably "allow cloning of subdirectories".
Here's how that would work:

 * add a file called "subdir" to .hg/store containing the subdirectory we're cloning
 * do a clone as usual, but don't write out revlogs that aren't in subdir
 * adjust the functions dealing with paths (localrepo.wjoin, etc.) appropriately
 * teach various things (checkout, status, etc.) to skip files outside the subdirectory
 * teach merge not allow merging when files outside the subdirectory conflict

Merging is the tricky part, and I expect there's a gotcha or two buried in there.


----

Problem: on large repos, it would be useful to be able to do a partial clone and/or checkout

Proposal: add a new file like .hgignore to the .hg/ directory that specifies which files should be ignored for clone/checkout.

[http://www.selenic.com/mercurial/bts/issue105 Issue105 in the BTS] covers partial checkouts and suggests using -X/-I on clone or checkout.

To implement:

  • pick a sensible name for this file (BryanOSullivan suggests ignoremissing)
  • teach localrepo to use this filtering where appropriate (checkout, pull)
  • teach changegroup to choke if someone attempts to pull a changeset from us with a file we don't have

Not to be confused with TrimmingHistory, which trims in the history tree, not the directory tree.


Comments from Matt Mackall:

> > How hard would this be to implement?

On a scale of 1 to 10, I'd rate it about a 7.

The simplest approach is probably "allow cloning of subdirectories". Here's how that would work:

  • add a file called "subdir" to .hg/store containing the subdirectory we're cloning
  • do a clone as usual, but don't write out revlogs that aren't in subdir
  • adjust the functions dealing with paths (localrepo.wjoin, etc.) appropriately
  • teach various things (checkout, status, etc.) to skip files outside the subdirectory
  • teach merge not allow merging when files outside the subdirectory conflict

Merging is the tricky part, and I expect there's a gotcha or two buried in there.


CategoryNewFeatures

PartialClone (last edited 2012-10-25 20:50:28 by mpm)