This is an old revision of the document!
Warner's Useful Mercurial Work Flow
I've been asked by several people to document my current Mercurial setup and work flow. While some people love git, others find it tedious and cumbersome to deal with. If you love git, use git. If not consider this work flow.
Required Setup
Ideally, this section would be “Install the devel/mercurial port” and then I'd move on. However, this port doesn't have the subversion upstream support baked into it. I use hgsubversion. While there is a FreeBSD port, as of this writing (June 5, 2014), it was too old (1.6.1) to support pulling from the FreeBSD repo due to FreeBSD's repo layout. So this section is a little longer…
Install Required Ports
Install the following ports. While one might be able to do clever things with linking svn to svnlite, I've had mixed results trying that and have always reverted to the actual svn port, since the SWIG bindings work a lot better than the command line bindings, and SWIG works a lot better with the full subversion port. While all this might not be strictly necessary, it is what I know works.
- devel/mercurial
- devel/subversion
- devel/py-subversion
Grab hgsubversion (not hgsvn)
I put this under $HOME/src like so after installing the above ports:
cd $HOME/src hg clone http://bitbucket.org/durin42/hgsubversion
The author knows that the following checkout works for him. There are plenty of newer revisions that might also work. Caveat Emptor.
% hg sum parent: 1146:4cdb0e95604f tip svncommands: call util.dump instead of manually writing file branch: default commit: (clean) update: (current) mq: (empty queue)
Enable hg extentions
You need to enable the mq (mercurial queues) and hgsubversion extentions in your $HOME/.hgrc file:
[ui] verbose=true username="Warner Losh <imp@freebsd.org>" [extensions] mq= hgsubversion=~/src/hgsubversion/hgsubversion
Note, I also set my username to my FreeBSD email address, and turn on verbose. While I normally like commands to be silent, I find that verbose tells me just enough about what's going on to know something has happened. But this may be because its verbosity is similar to cvs and svn's default settings and I've used those tools for a decade and a half…