Reorganize directory structure with Mercurial

I have a directory structure project

Foo/ .hg Bar1/ ... Bar2/ ... Zope/ ... 

I want to change this to

 Foo/ .hg Source/ Bar1/ ... Bar2/ ... Zope/ ... 

What is the easiest way? (There are too many files to move them one at a time. And there are several files with the same contents, so if I just move the files and ask Mercurial to get the details, then everything gets a little dirty.)

+4
source share
2 answers

Mercurial has a special command to move things: hg mv
When you move your folders like this, it’s known in history that Foo/Source/Bar/SomeFile previously Foo/Bar/SomeFile .
Therefore, when you look at the history of Foo/Source/Bar/SomeFile , you also see the changes that were made when the file was still Foo/Bar/SomeFile .

Here is an example of moving the Bar1 folder to the Source folder and Bar1 :

 hg mv Bar1 Source hg commit -m "moved to Source folder" 
+7
source

Drag the folders with two bars to the new source folder and commit.

0
source

Source: https://habr.com/ru/post/1403737/


All Articles