Hi all.
Yesterday I was talking with Bartosz ( a friend from Poland) and we're discussing about svn and mercurial. I never had used mercurial before.
Before begin technical skills to do that I need to explain situation.
If you're developer of a application that use svn and you have two computers, and you want to sync code but you can't commit it online. So mercurial it's a nice shot. I'm shipping with it.
In my example I have a desktop and a laptop (macbook) and I development lot of time in Desktop but some times I like to continue coding without commit and without copy the files by other system.
So how I can do that?
Syncing folder between a Mac and a Linux computerWhat do you need?
- mercurial
- ssh server
It's easy.
In Desktop computer:
$ cd root_svn_directory
$ hg init
you need to write a similar file here:
bastiao@bastiao-desktop:~/root_svn_directory$ cat .hg/hgrc
[ui]
username = Your name - desktop
bastiao@bastiao-desktop:~/root_svn_directory$
And you need to wrote .hgignore. The sample it's for python. It's extension to ignore. In my case I want to ignore .svn and pyc (byte compile) files.
bastiao@bastiao-desktop:~/root_svn_directory$ cat .hgignore
syntax: glob
*~
*.pyc
*.svn
bastiao@bastiao-desktop:~/root_svn_directory$
Nice in desktop.
Let's to laptop:
hg clone ssh://user@ip_or_host/root_svn_directory
add contents in .hg/hgrc similar of the desktop file
it's done
Now you only to do on server:
hg update
hg commit -m "message"
on the other computer, clients:
commit:
hg commit -m "message"
sync server: (push to server)
hg push
to update:
hg pull
hg update
Thanks Bart!