Split repository in sub repositories
myrepository has the following repositories:
- mysubdir1
- mysubdir2
- mysubdir3
- create filemap.txt:
include mysubdir1
rename mysubdir1 .
- run the following command:
hg convert --filemap /tmp/myfilemap myrepository myrepository-dest |
hg convert --filemap /tmp/myfilemap myrepository myrepository-dest
-
look at myrepository-dest. It has the content of mysubdir1.
Merge repositories
If you want to merge myrepository1 with myrepository2 :
echo clone myrepository2 to myworkingcopy
hg clone myrepository1 myworkingcopy
echo change directory to myworkingcopy
cd myworkingcopy
echo pull myrepository2 (with force option)
hg pull -f myrepository2
echo merge both repositories
hg merge
echo finally, commit
hg commit |
echo clone myrepository2 to myworkingcopy
hg clone myrepository1 myworkingcopy
echo change directory to myworkingcopy
cd myworkingcopy
echo pull myrepository2 (with force option)
hg pull -f myrepository2
echo merge both repositories
hg merge
echo finally, commit
hg commit
Get guid latest revision
hg identify -i http://srv-scm/hg/MYREPOSITORY |
hg identify -i http://srv-scm/hg/MYREPOSITORY
Clone without login/password prompt
hg clone http://mylogin:mypasswd@srv-scm/myrepos |
hg clone http://mylogin:mypasswd@srv-scm/myrepos
Subversion to mercurial
- clone hgsubversion
hg clone http://bitbucket.org/durin42/hgsubversion/ ~/hgsubversion |
hg clone http://bitbucket.org/durin42/hgsubversion/ ~/hgsubversion
- install requires (the extension requires the Python Subversion bindings)
yum install python-subvertpy |
yum install python-subvertpy
- Enable extension in mercurial
Configure your hgrc to enable the extension by adding the following lines: (vi ~/.hgrc)
[extensions]
hgsubversion = ~/hgsubversion/hgsubversion
And install it:
cd ~/hgsubversion
chmod +x setup.py
./setup.py install |
cd ~/hgsubversion
chmod +x setup.py
./setup.py install
- Test
hg --config clone http://python-nose.googlecode.com/svn nose-hg |
hg --config clone http://python-nose.googlecode.com/svn nose-hg
Remove working copy files
This will remove all your working copy files, and only keep the .hg folder (at the root place)