Wireshark-dev: [Wireshark-dev] Accessing Wireshark SVN using Bazaar

From: Evan Huus <eapache@xxxxxxxxx>
Date: Mon, 24 Sep 2012 22:23:04 -0400
This topic came up off-list and someone asked for a brief cheat-sheet
/ tutorial / explanation of what I currently use, so here it is. This
email is more about the various version-control systems (SVN, Git,
etc.) that manage Wireshark's source than it is about Wireshark
itself, so if you're perfectly happy with the existing subversion
setup you can stop reading here.

--

First a bit of background for those who are new to the topic.
Wireshark's source is currently managed using Subversion (SVN), and
has been ever since the migration from CVS long before I knew what
Wireshark even was. The current subversion tree can be browsed at [1].
Subversion is a mature, widely-respected tool. In the years since SVN
was designed and originally developed, a new model of version-control
system has been invented, known as the Distributed Version Control
System. This model is typified by Git and Mercurial, two popular
open-source DVCS tools. The DVCS model provides several advantages
which are well-enumerated on the relevant Wikipedia article [2]. For
just under a year now, Wireshark's code has also been available in a
read-only Git repository, viewable at [3].

I have been a big fan of DVCS tools for a while now, and so for some
time I would do my work in a read-only Git version of the source and
then copy my changes over to SVN in order to commit. Obviously, that
wasn't ideal.

There is a program (git plugin?) called git-svn that in theory allows
you to access a remote SVN repository as if it were a Git repository.
I've never been able to get it to work, but if somebody has steps to
follow for Wireshark, I'd be glad to hear them.

There is another DVCS program (less popular than Git or Mercurial, but
gaining ground now thanks to its use in Ubuntu) called Bazaar [4]. It
also has a plugin (called bzr-svn [5]) for transparently accessing SVN
repositories which I found quite easy to use. Both the Bazaar program
and the bzr-svn plugin are available in the Ubuntu repositories, and
are almost certainly in Debian/Fedora/etc. as well, though I haven't
checked. Windows and Mac users can get it at [6].

Once installed, you can get the wireshark source as follows:
$ bzr init-repo wireshark
$ cd wireshark
$ bzr checkout svn+http://anonsvn.wireshark.org/wireshark/trunk/
WARNING: the last command will take a *long* time (~24 hours I think,
although I haven't formally timed it), as it has to fetch each SVN
revision separately to build the local history. Once complete,
however, normal operations are just as fast (if not faster) than they
are in SVN.
NOTE: Devs with commit access should use the normal writable url, just
prepend "svn+" as I did for the read-only url.

With that done, you now have a working checkout in wireshark/trunk.
You can treat it just like an SVN copy except you replace 'svn'
commands with 'bzr' commands, so the majority of your time will be
spent doing 'bzr update', 'bzr commit', 'bzr status', 'bzr diff',
etc.. With a checkout like this, bzr treats the remote server just
like SVN does - there's no need to worry about the complications of
pushing and pulling and merging any more than normal. To convert it to
a more Git-style checkout (where the main operations are
push/pull/commit/merge instead of just update/commit) simply run 'bzr
unbind' (to convert back to an SVN-style checkout, just run 'bzr
bind').

I won't go into the details of using bazaar's advanced DCVS features
here (it's very similar to Git and Mercurial, and the documentation is
quite good), but this should be enough to kickstart anyone who is
interested. I will of course do my best to answer questions anyone
might have, but no guarantees.

Wow, this email ended up being a bit longer than I'd anticipated :)

Cheers,
Evan

[1] https://anonsvn.wireshark.org/viewvc/
[2] https://en.wikipedia.org/wiki/Distributed_revision_control
[3] http://code.wireshark.org/git/wireshark
[4] http://bazaar.canonical.com/en/
[5] http://doc.bazaar.canonical.com/beta/en/user-guide/svn_plugin.html
[6] http://wiki.bazaar.canonical.com/Download