I have created and used a Mercurial repository in someFolder
. Now I have discovered the need to keep track of files one level up. So what I would need is to create someOtherFolder
and move someFolder
into it. This should be no problem.
At this point I will have
someOtherFolder
someFolder
.hg
many other files
Is there a way to tell Mercurial to broaden its scope and start keeping track of files inside someOtherFolder
instead?
There's probably a nicer way to do this, but one thing you could do is hg mv
all the files to a new subdirectory someFolder
and then rename the parent someFolder
to someOtherFolder
, e.g.:
someFolder$ mkdir someFolder
someFolder$ hg locate | xargs --replace=FILE hg mv FILE someFolder/FILE
someFolder$ hg status
A someFolder/a.txt
A someFolder/foo/b.txt
R a.txt
R foo/b.txt
someFolder$ hg commit -m "moved files to subfolder"
someFolder$ cd ..
$ mv someFolder someOtherFolder
You should be able to use hg convert extension to do this.
I didn't test this, but something like this may work :
$ echo include someFolder > /tmp/myfilemap
$ echo rename someFolder someOtherFolder/someFolder >> /tmp/myfilemap
$ hg convert --filemap /tmp/myfilemap /path/to/repo/foo /tmp/mysubfoo-repo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With