Can I split a Mercurial repository?

前端 未结 3 441
北海茫月
北海茫月 2020-12-04 15:11

I have a largish Mercurial repository that I\'ve decided would be better as several smaller repositories. Is there a way that I can split the repository and have each piece

相关标签:
3条回答
  • 2020-12-04 15:58

    I found a detailed guide here:

    Create a file map new-repo.filemap such as

    include vendor/FooBackend
    rename vendor/FooBackend .
    

    Create another file map rewrite-old-repo.filemap:

    exclude vendor/FooBackend
    

    Create the new repository:

    hg convert /path/to/current/repo /path/to/new/repo --filemap new-repo.filemap
    

    The new repository is now finished. The directory is empty, but a hg update will bring its contents up to speed.

    Create the modified repository:

    hg convert /path/to/current/repo /path/to/rewritten/repo --filemap rewrite-old-repo.filemap
    
    0 讨论(0)
  • 2020-12-04 15:59

    Just clone it and delete the unwanted stuff out of each copy.

    0 讨论(0)
  • 2020-12-04 16:06

    The best way to do this is using the 'convert' extension. You'll use mercurial and both source and destination type and then use a --filemap with entries like:

    exclude path/you/do/not/want
    rename path/you/do/want .
    

    The rename is only necessary if you want to take the parts you're keeping and move them "higher" in the directory hierarchy.

    0 讨论(0)
提交回复
热议问题