distributed scm+freebsd svn?

Stanislav Sedov stas at FreeBSD.org
Mon Jul 27 10:05:58 UTC 2009


On Sun, 26 Jul 2009 16:15:34 -0700
Alfred Perlstein <alfred at freebsd.org> mentioned:

> Hello hackers,
> 
> Does anyone here use one of the distributed SCMs
> to manage contributions to FreeBSD in an easy
> manner?
> 
> Any pointers to a setup you have?
> 
> I thought "git" was supposed to make this easy, but
> going over the docs leaves me with a lot of questions.
> 
> I'm hoping to be able to basically:
>   sync into my "distributed repo".
>   allow a third party access to it.
>   easily commit upstream back into svn from a branch
>     in my distributed scm.
>

Hi, Alfred!

As far as I know there's a lot of people in the communtity
use distributed SCMs to work with FreeBSD repo: both git
and mercurial are popular.  I only used mercurial so I can
share my experience only on this SCM.

Since I started using it (about 2 years ago) I explored a number
of possible ways to keep my repo in sync with FreeBSD one
to make merges easier starting from hourly syncs by simple
"cvsup + hg commit" (outlined at wiki) and ending by full
repository conversions. Luckily enough after switch to subversion
it is now possibleto convert the full repo with all history both
to git and hg without much problem.  Currently I'm using the Hg
convert extentsion bundled into the default mercurial install.
I made the result of conversion available here:
http://repoman.deglitch.com/bsdhg/FreeBSD/base/
It is updated regularly (every 15 minutes) from the local svn mirror.
The size of converted repo is about 885 MiB (with all known branches and
tags and entire history).
 
Some points to note if you will try do the initial conversion yourself:
1) Use memory disk for repository storage.  That will spedup things a
  lot (an order of magnitude).
2) Hg convert extension expect the default svn layout (i.e. trunk/ for
  head, tags/ for tags and branches/ for branches).  FreeBSD doesn't follow
  this layout so I had to tweak the application by hand to allow it to found
  our branches.  It is possible to use command line switches to point it
  to your trunk, tags and branches location, but as we effectively have two
  root-level folders for branches (stable/ and releng/) it doesn't work well,
  so I had to add yet one switch to point to another branches folder.
3) Using local svn mirror is usually preferrable for performance matters.

For development I usually do a branch clone (either from "head" branch,
or some "stable" branch depending what I'm going to work on) by "hg
clone" command and then do my work in that branch (ordiary commit/pull/push
workflow, nothing specific).  Whenever I need to sync with head I do
a pull from the parent branch (e.g. hg pull -r head
ssh://stas@repoman.deglitch.com/bsdhg/FreeBSD/base/) and then hg merge -r
head.  This works like a charm for any kind of work I do.  When there's
a need to get a diff between the stock FreeBSD tree and you tree you can
achieve this by using hg diff -r "youbranch" -r "head".  I do not perform
commits directly from mercurial, but there're extensions to do this, afaik.
This just doesn't sound useful much for me.

Access to 3rd party users can be granted the same way it is done in other
source control systems.  I prefer the plain ssh access for this task by
configuring a jail with repository access and creating users accounts
with limited access and the special wrapper instead of login shell which
allows execution of the limited set of commands.  Today such kind of shell
is already included into the distribution so there's no need to hack up
your own version. 

-- 
Stanislav Sedov
ST4096-RIPE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20090727/a286f8af/attachment.pgp


More information about the freebsd-hackers mailing list