Size: 468
Comment:
|
Size: 2919
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
[[http://www.selenic.com/mercurial/bts/issue105|Issue105 in the BTS]] covers partial checkouts and suggests using -X/-I on clone or checkout. |
|
Line 7: | Line 9: |
* pick a sensible name for this file | * pick a sensible name for this file (BryanOSullivan suggests ignoremissing) |
Line 10: | Line 12: |
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. ---- RyanF: I would also like to see a filtering option or partial clone, but with support for the include and exclude (-I, -X). We are writing an open source Mavenesque (but much simpler) tool that manages very large products and dependencies involving multiple repositories. It requires a Dependencies.lookup in the root of any repos module but it does not seem possible for us to checkout a single file with hg. It would be fine for our needs if an interim solution checked out the subset of files in a read-only mode. ---- trisk: ConvertExtension appears to already provide the ability to perform partial clones by generating a new full repository, as described under "Converting from Mercurial". * You can use this, today, without waiting for additional subdir support to arrive * For the same reason, it probably doesn't handle merging ---- jasonrohrer: Unfortunately, ConvertExtension doesn't really create a clone, since it doesn't remember where the repository came from. So after the convert, you cannot pull or push back to the source of the clone. Great for creating new subdir repositories that will operate in isolation from the source, but not for creating subdirs that actually work with the other, full repositories. Thus, I'd say: * You CANNOT use this, today, without waiting for additional subdir support to arrive (Though I might be missing something!) ---- CategoryNewFeatures |
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.
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.
RyanF: I would also like to see a filtering option or partial clone, but with support for the include and exclude (-I, -X). We are writing an open source Mavenesque (but much simpler) tool that manages very large products and dependencies involving multiple repositories. It requires a Dependencies.lookup in the root of any repos module but it does not seem possible for us to checkout a single file with hg.
It would be fine for our needs if an interim solution checked out the subset of files in a read-only mode.
trisk: ConvertExtension appears to already provide the ability to perform partial clones by generating a new full repository, as described under "Converting from Mercurial".
- You can use this, today, without waiting for additional subdir support to arrive
- For the same reason, it probably doesn't handle merging
jasonrohrer: Unfortunately, ConvertExtension doesn't really create a clone, since it doesn't remember where the repository came from. So after the convert, you cannot pull or push back to the source of the clone. Great for creating new subdir repositories that will operate in isolation from the source, but not for creating subdirs that actually work with the other, full repositories. Thus, I'd say:
- You CANNOT use this, today, without waiting for additional subdir support to arrive
(Though I might be missing something!)