[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: atomic svnsync

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: Sun, 27 Jan 2008 19:03:10 +0900 (JST)

Hi,

In <47990681.8060509_at_mobsol.be>
  "Re: atomic svnsync" on Thu, 24 Jan 2008 22:43:29 +0100,
  Lieven Govaerts <svnlgo_at_mobsol.be> wrote:

> > Goal: I want to use my local commit-email.rb (in post-commit
> > hook) for external Subversion repository. I only have read
> > only permission for the external repository. Or I want to
> > set up commit-email.rb only for me.
> >
> > Strategy:
> > * svnadmin create /.../repos
> > * vim /.../repos/hooks/pre-revprop-change
> > * vim /.../repos/hooks/post-commit # set up commit-email.rb
> > * svnsync init file:///.../repos http://.../repos
> > * svnsync sync # commit mail is sent for each commit
> >
> > Problem: svnsync needs 2 processes to synchronize
> > repositories. They are (1) synchronizing changes and
> > properties except revision properties and (2) synchronizing
> > revision properties. post-commit hook is invoked on (1) and
> > commit-email.rb is also invoked. But some important
> > information, author, log message and so on, aren't
> > synchronized at this time yet. They are synchronized on (2).

> > Solution idea: I can use post-commit hook like a usual
> > repository if svnsync just needs a process to synchronize
> > repository. In 1.5 API, we have svn_ra_get_commit_editor3()
> > that accepts revision properties. But FS layer don't use
> > passed some revision properties, date and author.
>
> The current svnsync code on trunk will include all revprops with the
> commit, except the two you mention. So on post-commit you'll have all
> info expect author and date.

Thanks for the information but I want to use author info
too...

> > We may be
> > able to decide whether we use those revision properties or
> > not with hook mechanism. I don't have a good name idea but
> > what about pre-commit-revprop hook?
> >
>
> As a workaround for your problem, you can use some knowledge about the
> internals of svnsync. Before starting to copy the revision contents,
> svnsync will set a revprop called 'svn:sync-currently-copying', which it
> will remove right after the svn:date and svn:author revprops are copied.
> So, write a post-revprop-change hook that checks for the removal of this
> revprop, takes the revision argument and uses svnlook to read all needed
> info from the repository.
>
> As it depends on the way svnsync is implemented - which may change - I
> wouldn't call it a solution, but at least it can serve as a temporary
> workaround.

Uhm, it's too ad hoc way... but thanks for your idea.

> The most decent solution IMHO would be to allow passing the svn:author
> and svn:date revprops on commit.

I think so too. Who is the proper person for requesting the
feature?

Thanks,

--
kou
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-01-27 11:03:35 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.