Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I extend a mercurial repository to include parent folder?

Tags:

mercurial

Now, I have a source tree as following:

+ Dev
  +-- Source
  |  +-- ...
  +-- Samples
  |  +-- ...
  +-- ...

Beginning, I had create a Mercurial repository in folder "Dev/Source". It's work fine. But now, I want extend the repository to include "Dev/Samples" folder too. I found only one way to do that. I must drop old repository and create a new in "Dev" folder. But the version history of original repository is so important for me. There has any solution to import original history to new repository? or Mercurial has another support to change the root folder of repository?

Thanks.

like image 503
Colin Han Avatar asked Dec 12 '22 15:12

Colin Han


1 Answers

You can

  • use the convert extension to create a new repo with the aligned files (see the --filemap option)
  • create a Source folder in your repo and move all files within there

The first one provides a cleaner history, while the second one does not invalidate existing clones.

like image 92
Rudi Avatar answered May 21 '23 09:05

Rudi