I have a single-person single-folder mercurial repository. The directory structure is simple:
P104
lecture_notes
files under version control live here
After a while I realize I want to have two directories within the repository, like this
P104
lecture_notes
files under version control live here (.hg is here)
homework
more files under version control
Now, if I’m just trying to add files to the repository, it fails:
br@ymir:~/P104/lecture_notes$ ll ..
total 16
drwxr-xr-x 4 br br 4096 2012-02-02 18:05 ./
drwxr-xr-x 4 br br 4096 2012-02-01 20:46 ../
drwxr-xr-x 2 br br 4096 2012-02-02 17:44 homework/
drwxr-xr-x 4 br br 4096 2012-02-02 18:06 lecture_notes/
br@ymir:~/P104/lecture_notes$ hg add ../homework/hw1_P104.tex
abort: ../homework/hw1_P104.tex not under root
My first idea was to clone the repo one level up in the directory structure, add files to the clone, and delete the original repo. But even cloning fails:
br@ymir:~/P104/2011/lecture_notes$ hg clone . ..
abort: destination '..' is not empty
So the question is whether there’s a Mercurial-ish way of doing this other than creating a clean repository somewhere else and copying files manually?
If the root directory of your Mercurial repo is under
~/P104/lecture_notes, I would rather:lecture_notesinto P104lecture_noteshomeworkand its files in the renamed P104 directoryhg addeverythingThe idea is to keep the
.hgrepo where it is (~/P104/lecture_notesrenamed into~/P104/P104) and reorganize the files within that renamed directory.No need to clone.