2

How can I get

oldrepo/some/path/to/stuffOfInterest/...

Into

newRepo/stuffOfInterest/...

We need to split out part ot the oldRepo (which was a straightSubversion import) into its own repository, and we'd like to preserve the history.

Is there some way we can get all the changesets related to particular files/directories and push only them into a new repo?

flag

2 Answers

3

hg convert is the best way to do this. The documentation is pretty good. You'll want to set up a filemap, which specifies the files and directories you want to the new repo.

Note that if you want to move a directory up a level, you'll want the rename directive.

link|flag
2 
@Tyler, Cheers! the rename is the really useful part of this process, e.g. "rename some/deep/nested/path ." in the filemap - We'd already used convert to extract out of the repo when we moved from SVN. – Byron Ross 0 secs ago – Byron Ross May 17 2010 at 2:10
Also note that hg convert will take other types of repos, like SVN. It's actually what the KilnImporter uses (with fewer exposed options). – Tyler Hicks-Wright May 17 2010 at 15:11
2

Also, the Kiln Importer can be used to handle this simple case if the Mercurial repo is on the local machine, by just typing the full path to the directory that you want to extract into it's own repository.

link|flag
Thanks @Rock, I'll try that next time. Does it do the path rename for you? – Byron Ross May 19 2010 at 0:17
Yeah, if it's just renaming the path to "." then it takes care of that. – Rock Hymas May 19 2010 at 13:03

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.