You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jon Foster <Jo...@cabot.co.uk> on 2009/11/27 17:14:08 UTC
[PATCH] Add svnsync --use-external-locking option
Hi,
As discussed on this list, we don't always need svnsync's networked
lock. If svnsync only runs on a single server, the administrator
can use the "flock" tool to prevent running multiple copies of
svnsync at the same time.
And if svnsync's lock is not needed, then it is actually an
inconvenience. E.g. if the network connection fails, then a stale
lock can be left behind. This requires manual administrator
intervention to fix.
One workaround is for your scripts to run this command immediately
before they start svnsync:
svn propdel svn:sync-lock --revprop -r0 $target_url
However, it would be better to provide a command-line option to
disable svnsync's locking. So, here's a patch to do that.
The option name has been chosen to try to make it obvious that no
locking is a bad idea, and administrators should either use
svnsync's internal locking or have their own external locking.
[[[
Add --using-external-locking option to svnsync.
* subversion/svnsync/main.c
(svnsync__opt): Add svnsync_opt_using_external_locking.
(SVNSYNC_OPTS_DEFAULT): Add svnsync_opt_using_external_locking.
(svnsync_options): Add entry for --using-external-locking.
(opt_baton_t): Add using_external_locking member.
(initialize_cmd, synchronize_cmd, copy_revprops_cmd): Don't take the
lock if using external locking.
(main): Handle svnsync_opt_using_external_locking option.
Patch by: Jon Foster <Jo...@cabot.co.uk>
]]]
Kind regards,
Jon
**********************************************************************
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.
If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
Cabot Communications Limited
Verona House, Filwood Road, Bristol BS16 3RY, UK
+44 (0) 1179584232
Co. Registered in England number 02817269
Please contact the sender if you believe you have received this email in error.
**********************************************************************
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Re: [PATCH] Add svnsync --use-external-locking option
Posted by Julian Foad <ju...@btopenworld.com>.
Gavin 'Beau' Baumanis wrote:
> On 10/12/2009, at 00:11 , Julian Foad wrote:
[...]
> > 1. It's probably a good idea to point out in these emails that logging
> > the patch into the issue tracker does not very much increase the chance
> > of it being applied, it just makes it easier for us to keep track of its
> > status, and it could sit there for ever. The original submitter should
> > try to find out why it is not being applied and see if there is
> > something he/she can do to help.
>
> Yes, good idea.
> It is not something I had thought of myself - thanks for the
> suggestion I will incorporate it into the follow-up email I send when
> it has gone to the tracker.
>
> > 2. Please could you always add a link to the archived email thread when
> > filing an issue.
>
> I "normally" do add in the URL for the original email or email thread
> when creating a Patch submission in the tracker.
> I also noticed your follow-ups last night and subsequent email to the
> list abut having the url added to the footer of messages - which will
> help in future.
Thanks!
- Julian
Re: [PATCH] Add svnsync --use-external-locking option
Posted by Julian Foad <ju...@btopenworld.com>.
Gavin 'Beau' Baumanis wrote:
> On 10/12/2009, at 00:11 , Julian Foad wrote:
[...]
> > 1. It's probably a good idea to point out in these emails that logging
> > the patch into the issue tracker does not very much increase the chance
> > of it being applied, it just makes it easier for us to keep track of its
> > status, and it could sit there for ever. The original submitter should
> > try to find out why it is not being applied and see if there is
> > something he/she can do to help.
>
> Yes, good idea.
> It is not something I had thought of myself - thanks for the
> suggestion I will incorporate it into the follow-up email I send when
> it has gone to the tracker.
>
> > 2. Please could you always add a link to the archived email thread when
> > filing an issue.
>
> I "normally" do add in the URL for the original email or email thread
> when creating a Patch submission in the tracker.
> I also noticed your follow-ups last night and subsequent email to the
> list abut having the url added to the footer of messages - which will
> help in future.
Thanks!
- Julian
Re: [PATCH] Add svnsync --use-external-locking option
Posted by Gavin 'Beau' Baumanis <ga...@thespidernet.com>.
Hi Julian,
On 10/12/2009, at 00:11 , Julian Foad wrote:
> Gavin 'Beau' Baumanis wrote:
>> Hi Jon,
>>
>> I have logged your patch into the issue tracker: #3545
>> http://subversion.tigris.org/issues/show_bug.cgi?id=3545
>
> Hi Gavin. It's great that you are keeping these patches under control. I
> have a couple of suggestions:
>
> 1. It's probably a good idea to point out in these emails that logging
> the patch into the issue tracker does not very much increase the chance
> of it being applied, it just makes it easier for us to keep track of its
> status, and it could sit there for ever. The original submitter should
> try to find out why it is not being applied and see if there is
> something he/she can do to help.
>
Yes, good idea.
It is not something I had thought of myself - thanks for the suggestion I will incorporate it into the follow-up email I send when it has gone to the tracker.
> 2. Please could you always add a link to the archived email thread when
> filing an issue.
>
I "normally" do add in the URL for the original email or email thread when creating a Patch submission in the tracker.
I also noticed your follow-ups last night and subsequent email to the list abut having the url added to the footer of messages - which will help in future.
Gavin.
Re: [PATCH] Add svnsync --use-external-locking option
Posted by Gavin 'Beau' Baumanis <ga...@thespidernet.com>.
Hi Julian,
On 10/12/2009, at 00:11 , Julian Foad wrote:
> Gavin 'Beau' Baumanis wrote:
>> Hi Jon,
>>
>> I have logged your patch into the issue tracker: #3545
>> http://subversion.tigris.org/issues/show_bug.cgi?id=3545
>
> Hi Gavin. It's great that you are keeping these patches under control. I
> have a couple of suggestions:
>
> 1. It's probably a good idea to point out in these emails that logging
> the patch into the issue tracker does not very much increase the chance
> of it being applied, it just makes it easier for us to keep track of its
> status, and it could sit there for ever. The original submitter should
> try to find out why it is not being applied and see if there is
> something he/she can do to help.
>
Yes, good idea.
It is not something I had thought of myself - thanks for the suggestion I will incorporate it into the follow-up email I send when it has gone to the tracker.
> 2. Please could you always add a link to the archived email thread when
> filing an issue.
>
I "normally" do add in the URL for the original email or email thread when creating a Patch submission in the tracker.
I also noticed your follow-ups last night and subsequent email to the list abut having the url added to the footer of messages - which will help in future.
Gavin.
RE: [PATCH] Add svnsync --use-external-locking option
Posted by Jon Foster <Jo...@cabot.co.uk>.
Hi,
-----Original Message-----
From: Julian Foad [mailto:julianfoad@btopenworld.com]
Sent: 09 December 2009 13:11
To: Gavin 'Beau' Baumanis
Cc: Jon Foster; dev@subversion.apache.org
Subject: Re: [PATCH] Add svnsync --use-external-locking option
Gavin 'Beau' Baumanis wrote:
> Hi Jon,
>
> I have logged your patch into the issue tracker: #3545
> http://subversion.tigris.org/issues/show_bug.cgi?id=3545
Hi Gavin. It's great that you are keeping these patches under control. I
have a couple of suggestions:
1. It's probably a good idea to point out in these emails that logging
the patch into the issue tracker does not very much increase the chance
of it being applied, it just makes it easier for us to keep track of its
status, and it could sit there for ever. The original submitter should
try to find out why it is not being applied and see if there is
something he/she can do to help.
2. Please could you always add a link to the archived email thread when
filing an issue.
Thanks.
- Julian
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
**********************************************************************
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.
If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
Cabot Communications Limited
Verona House, Filwood Road, Bristol BS16 3RY, UK
+44 (0) 1179584232
Co. Registered in England number 02817269
Please contact the sender if you believe you have received this email in error.
**********************************************************************
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
RE: [PATCH] Add svnsync --use-external-locking option
Posted by Jon Foster <Jo...@cabot.co.uk>.
Hi,
Julian Foad wrote:
> Gavin 'Beau' Baumanis wrote:
> > Hi Jon,
> >
> > I have logged your patch into the issue tracker: #3545
> > http://subversion.tigris.org/issues/show_bug.cgi?id=3545
>
> Hi Gavin. It's great that you are keeping these patches under control.
I
> have a couple of suggestions:
>
> 1. It's probably a good idea to point out in these emails that logging
> the patch into the issue tracker does not very much increase the
chance
> of it being applied, it just makes it easier for us to keep track of
its
> status, and it could sit there for ever. The original submitter should
> try to find out why it is not being applied and see if there is
> something he/she can do to help.
I suspect I need to resend my patches as plaintext attachments, to
increase the chances of them being reviewed. However, the legal issues*
need to be sorted out first. (Our solicitors** are reading the CLA.
Unless/until they approve it there's no point in me sending patches.
This is likely to take a while; I'm not expecting an answer until the
New Year).
Kind regards,
Jon
[*]
http://mail-archives.apache.org/mod_mbox/subversion-dev/200912.mbox/%3C8
78wded0ib.fsf@red-bean.com%3E
[**] A UK "solicitor" is the equivalent of a US "lawyer".
**********************************************************************
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.
If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
Cabot Communications Limited
Verona House, Filwood Road, Bristol BS16 3RY, UK
+44 (0) 1179584232
Co. Registered in England number 02817269
Please contact the sender if you believe you have received this email in error.
**********************************************************************
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Re: [PATCH] Add svnsync --use-external-locking option
Posted by Julian Foad <ju...@btopenworld.com>.
Gavin 'Beau' Baumanis wrote:
> Hi Jon,
>
> I have logged your patch into the issue tracker: #3545
> http://subversion.tigris.org/issues/show_bug.cgi?id=3545
Hi Gavin. It's great that you are keeping these patches under control. I
have a couple of suggestions:
1. It's probably a good idea to point out in these emails that logging
the patch into the issue tracker does not very much increase the chance
of it being applied, it just makes it easier for us to keep track of its
status, and it could sit there for ever. The original submitter should
try to find out why it is not being applied and see if there is
something he/she can do to help.
2. Please could you always add a link to the archived email thread when
filing an issue.
Thanks.
- Julian
Re: [PATCH] Add svnsync --use-external-locking option
Posted by Julian Foad <ju...@btopenworld.com>.
Gavin 'Beau' Baumanis wrote:
> Hi Jon,
>
> I have logged your patch into the issue tracker: #3545
> http://subversion.tigris.org/issues/show_bug.cgi?id=3545
Hi Gavin. It's great that you are keeping these patches under control. I
have a couple of suggestions:
1. It's probably a good idea to point out in these emails that logging
the patch into the issue tracker does not very much increase the chance
of it being applied, it just makes it easier for us to keep track of its
status, and it could sit there for ever. The original submitter should
try to find out why it is not being applied and see if there is
something he/she can do to help.
2. Please could you always add a link to the archived email thread when
filing an issue.
Thanks.
- Julian
Re: [PATCH] Add svnsync --use-external-locking option
Posted by Gavin 'Beau' Baumanis <ga...@thespidernet.com>.
Hi Jon,
I have logged your patch into the issue tracker: #3545
http://subversion.tigris.org/issues/show_bug.cgi?id=3545
Gavin
On 28/11/2009, at 03:32 , Jon Foster wrote:
> [Very sorry, my mailserver appears to be dropping attachments
> and mangling inline patches by word-wrapping them.
> Trying yet again, with patch as a ZIP file.]
>
> Hi,
>
> As discussed on this list, we don't always need svnsync's networked
> lock. If svnsync only runs on a single server, the administrator
> can use the "flock" tool to prevent running multiple copies of
> svnsync at the same time.
>
> And if svnsync's lock is not needed, then it is actually an
> inconvenience. E.g. if the network connection fails, then a stale
> lock can be left behind. This requires manual administrator
> intervention to fix.
>
> One workaround is for your scripts to run this command immediately
> before they start svnsync:
> svn propdel svn:sync-lock --revprop -r0 $target_url
>
> However, it would be better to provide a command-line option to
> disable svnsync's locking. So, here's a patch to do that.
>
> The option name has been chosen to try to make it obvious that no
> locking is a bad idea, and administrators should either use
> svnsync's internal locking or have their own external locking.
>
> [[[
> Add --using-external-locking option to svnsync.
>
> * subversion/svnsync/main.c
> (svnsync__opt): Add svnsync_opt_using_external_locking.
> (SVNSYNC_OPTS_DEFAULT): Add svnsync_opt_using_external_locking.
> (svnsync_options): Add entry for --using-external-locking.
> (opt_baton_t): Add using_external_locking member.
> (initialize_cmd, synchronize_cmd, copy_revprops_cmd): Don't take the
> lock if using external locking.
> (main): Handle svnsync_opt_using_external_locking option.
>
> Patch by: Jon Foster <Jo...@cabot.co.uk>
> ]]]
>
> Kind regards,
>
> Jon
>
>
> **********************************************************************
> This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.
>
> If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
>
> Cabot Communications Limited
> Verona House, Filwood Road, Bristol BS16 3RY, UK
> +44 (0) 1179584232
>
> Co. Registered in England number 02817269
>
> Please contact the sender if you believe you have received this email in error.
>
> **********************************************************************
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________<svnsync-external-locking.zip>
Re: [PATCH] Add svnsync --use-external-locking option
Posted by Gavin 'Beau' Baumanis <ga...@thespidernet.com>.
Ping.
This Patch submission has received no comments.
Gavin.
On 28/11/2009, at 03:32 , Jon Foster wrote:
> [Very sorry, my mailserver appears to be dropping attachments
> and mangling inline patches by word-wrapping them.
> Trying yet again, with patch as a ZIP file.]
>
> Hi,
>
> As discussed on this list, we don't always need svnsync's networked
> lock. If svnsync only runs on a single server, the administrator
> can use the "flock" tool to prevent running multiple copies of
> svnsync at the same time.
>
> And if svnsync's lock is not needed, then it is actually an
> inconvenience. E.g. if the network connection fails, then a stale
> lock can be left behind. This requires manual administrator
> intervention to fix.
>
> One workaround is for your scripts to run this command immediately
> before they start svnsync:
> svn propdel svn:sync-lock --revprop -r0 $target_url
>
> However, it would be better to provide a command-line option to
> disable svnsync's locking. So, here's a patch to do that.
>
> The option name has been chosen to try to make it obvious that no
> locking is a bad idea, and administrators should either use
> svnsync's internal locking or have their own external locking.
>
> [[[
> Add --using-external-locking option to svnsync.
>
> * subversion/svnsync/main.c
> (svnsync__opt): Add svnsync_opt_using_external_locking.
> (SVNSYNC_OPTS_DEFAULT): Add svnsync_opt_using_external_locking.
> (svnsync_options): Add entry for --using-external-locking.
> (opt_baton_t): Add using_external_locking member.
> (initialize_cmd, synchronize_cmd, copy_revprops_cmd): Don't take the
> lock if using external locking.
> (main): Handle svnsync_opt_using_external_locking option.
>
> Patch by: Jon Foster <Jo...@cabot.co.uk>
> ]]]
>
> Kind regards,
>
> Jon
>
>
> **********************************************************************
> This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.
>
> If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
>
> Cabot Communications Limited
> Verona House, Filwood Road, Bristol BS16 3RY, UK
> +44 (0) 1179584232
>
> Co. Registered in England number 02817269
>
> Please contact the sender if you believe you have received this email in error.
>
> **********************************************************************
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________<svnsync-external-locking.zip>
Re: [PATCH] Add svnsync --use-external-locking option
Posted by Gavin 'Beau' Baumanis <ga...@thespidernet.com>.
Ping.
This Patch submission has received no comments.
Gavin.
On 28/11/2009, at 03:32 , Jon Foster wrote:
> [Very sorry, my mailserver appears to be dropping attachments
> and mangling inline patches by word-wrapping them.
> Trying yet again, with patch as a ZIP file.]
>
> Hi,
>
> As discussed on this list, we don't always need svnsync's networked
> lock. If svnsync only runs on a single server, the administrator
> can use the "flock" tool to prevent running multiple copies of
> svnsync at the same time.
>
> And if svnsync's lock is not needed, then it is actually an
> inconvenience. E.g. if the network connection fails, then a stale
> lock can be left behind. This requires manual administrator
> intervention to fix.
>
> One workaround is for your scripts to run this command immediately
> before they start svnsync:
> svn propdel svn:sync-lock --revprop -r0 $target_url
>
> However, it would be better to provide a command-line option to
> disable svnsync's locking. So, here's a patch to do that.
>
> The option name has been chosen to try to make it obvious that no
> locking is a bad idea, and administrators should either use
> svnsync's internal locking or have their own external locking.
>
> [[[
> Add --using-external-locking option to svnsync.
>
> * subversion/svnsync/main.c
> (svnsync__opt): Add svnsync_opt_using_external_locking.
> (SVNSYNC_OPTS_DEFAULT): Add svnsync_opt_using_external_locking.
> (svnsync_options): Add entry for --using-external-locking.
> (opt_baton_t): Add using_external_locking member.
> (initialize_cmd, synchronize_cmd, copy_revprops_cmd): Don't take the
> lock if using external locking.
> (main): Handle svnsync_opt_using_external_locking option.
>
> Patch by: Jon Foster <Jo...@cabot.co.uk>
> ]]]
>
> Kind regards,
>
> Jon
>
>
> **********************************************************************
> This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.
>
> If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
>
> Cabot Communications Limited
> Verona House, Filwood Road, Bristol BS16 3RY, UK
> +44 (0) 1179584232
>
> Co. Registered in England number 02817269
>
> Please contact the sender if you believe you have received this email in error.
>
> **********************************************************************
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________<svnsync-external-locking.zip>
Re: [PATCH] Add svnsync --use-external-locking option
Posted by Gavin 'Beau' Baumanis <ga...@thespidernet.com>.
Hi Jon,
I have logged your patch into the issue tracker: #3545
http://subversion.tigris.org/issues/show_bug.cgi?id=3545
Gavin
On 28/11/2009, at 03:32 , Jon Foster wrote:
> [Very sorry, my mailserver appears to be dropping attachments
> and mangling inline patches by word-wrapping them.
> Trying yet again, with patch as a ZIP file.]
>
> Hi,
>
> As discussed on this list, we don't always need svnsync's networked
> lock. If svnsync only runs on a single server, the administrator
> can use the "flock" tool to prevent running multiple copies of
> svnsync at the same time.
>
> And if svnsync's lock is not needed, then it is actually an
> inconvenience. E.g. if the network connection fails, then a stale
> lock can be left behind. This requires manual administrator
> intervention to fix.
>
> One workaround is for your scripts to run this command immediately
> before they start svnsync:
> svn propdel svn:sync-lock --revprop -r0 $target_url
>
> However, it would be better to provide a command-line option to
> disable svnsync's locking. So, here's a patch to do that.
>
> The option name has been chosen to try to make it obvious that no
> locking is a bad idea, and administrators should either use
> svnsync's internal locking or have their own external locking.
>
> [[[
> Add --using-external-locking option to svnsync.
>
> * subversion/svnsync/main.c
> (svnsync__opt): Add svnsync_opt_using_external_locking.
> (SVNSYNC_OPTS_DEFAULT): Add svnsync_opt_using_external_locking.
> (svnsync_options): Add entry for --using-external-locking.
> (opt_baton_t): Add using_external_locking member.
> (initialize_cmd, synchronize_cmd, copy_revprops_cmd): Don't take the
> lock if using external locking.
> (main): Handle svnsync_opt_using_external_locking option.
>
> Patch by: Jon Foster <Jo...@cabot.co.uk>
> ]]]
>
> Kind regards,
>
> Jon
>
>
> **********************************************************************
> This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.
>
> If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
>
> Cabot Communications Limited
> Verona House, Filwood Road, Bristol BS16 3RY, UK
> +44 (0) 1179584232
>
> Co. Registered in England number 02817269
>
> Please contact the sender if you believe you have received this email in error.
>
> **********************************************************************
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________<svnsync-external-locking.zip>
RE: [PATCH] Add svnsync --use-external-locking option
Posted by Jon Foster <Jo...@cabot.co.uk>.
[Very sorry, my mailserver appears to be dropping attachments
and mangling inline patches by word-wrapping them.
Trying yet again, with patch as a ZIP file.]
Hi,
As discussed on this list, we don't always need svnsync's networked
lock. If svnsync only runs on a single server, the administrator
can use the "flock" tool to prevent running multiple copies of
svnsync at the same time.
And if svnsync's lock is not needed, then it is actually an
inconvenience. E.g. if the network connection fails, then a stale
lock can be left behind. This requires manual administrator
intervention to fix.
One workaround is for your scripts to run this command immediately
before they start svnsync:
svn propdel svn:sync-lock --revprop -r0 $target_url
However, it would be better to provide a command-line option to
disable svnsync's locking. So, here's a patch to do that.
The option name has been chosen to try to make it obvious that no
locking is a bad idea, and administrators should either use
svnsync's internal locking or have their own external locking.
[[[
Add --using-external-locking option to svnsync.
* subversion/svnsync/main.c
(svnsync__opt): Add svnsync_opt_using_external_locking.
(SVNSYNC_OPTS_DEFAULT): Add svnsync_opt_using_external_locking.
(svnsync_options): Add entry for --using-external-locking.
(opt_baton_t): Add using_external_locking member.
(initialize_cmd, synchronize_cmd, copy_revprops_cmd): Don't take the
lock if using external locking.
(main): Handle svnsync_opt_using_external_locking option.
Patch by: Jon Foster <Jo...@cabot.co.uk>
]]]
Kind regards,
Jon
**********************************************************************
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.
If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
Cabot Communications Limited
Verona House, Filwood Road, Bristol BS16 3RY, UK
+44 (0) 1179584232
Co. Registered in England number 02817269
Please contact the sender if you believe you have received this email in error.
**********************************************************************
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
RE: [PATCH] Add svnsync --use-external-locking option
Posted by Jon Foster <Jo...@cabot.co.uk>.
[Sorry, my mailserver appears to be dropping attachments today.
Trying again, with patch inline at end of the mail]
Hi,
As discussed on this list, we don't always need svnsync's networked
lock. If svnsync only runs on a single server, the administrator
can use the "flock" tool to prevent running multiple copies of
svnsync at the same time.
And if svnsync's lock is not needed, then it is actually an
inconvenience. E.g. if the network connection fails, then a stale
lock can be left behind. This requires manual administrator
intervention to fix.
One workaround is for your scripts to run this command immediately
before they start svnsync:
svn propdel svn:sync-lock --revprop -r0 $target_url
However, it would be better to provide a command-line option to
disable svnsync's locking. So, here's a patch to do that.
The option name has been chosen to try to make it obvious that no
locking is a bad idea, and administrators should either use
svnsync's internal locking or have their own external locking.
[[[
Add --using-external-locking option to svnsync.
* subversion/svnsync/main.c
(svnsync__opt): Add svnsync_opt_using_external_locking.
(SVNSYNC_OPTS_DEFAULT): Add svnsync_opt_using_external_locking.
(svnsync_options): Add entry for --using-external-locking.
(opt_baton_t): Add using_external_locking member.
(initialize_cmd, synchronize_cmd, copy_revprops_cmd): Don't take the
lock if using external locking.
(main): Handle svnsync_opt_using_external_locking option.
Patch by: Jon Foster <Jo...@cabot.co.uk>
]]]
Kind regards,
Jon
Index: subversion/svnsync/main.c
===================================================================
--- subversion/svnsync/main.c (revision 884900)
+++ subversion/svnsync/main.c (working copy)
@@ -61,6 +61,7 @@
svnsync_opt_sync_password,
svnsync_opt_config_dir,
svnsync_opt_config_options,
+ svnsync_opt_using_external_locking,
svnsync_opt_version,
svnsync_opt_trust_server_cert,
svnsync_opt_allow_non_empty,
@@ -76,7 +77,8 @@
svnsync_opt_sync_username, \
svnsync_opt_sync_password, \
svnsync_opt_config_dir, \
- svnsync_opt_config_options
+ svnsync_opt_config_options, \
+ svnsync_opt_using_external_locking
static const svn_opt_subcommand_desc2_t svnsync_cmd_table[] =
{
@@ -180,6 +182,10 @@
"For example:\n"
" "
" servers:global:http-library=serf")},
+ {"using-external-locking", svnsync_opt_using_external_locking, 0,
+ N_("Disable built in locking. You must ensure
that\n"
+ " "
+ "no other instance of svnsync is running.")},
{"version", svnsync_opt_version, 0,
N_("show program version information")},
{"help", 'h', 0,
@@ -201,6 +207,7 @@
const char *sync_password;
const char *config_dir;
apr_hash_t *config;
+ svn_boolean_t using_external_locking;
svn_boolean_t quiet;
svn_boolean_t allow_non_empty;
svn_boolean_t version;
@@ -798,7 +805,14 @@
SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
&(baton->sync_callbacks), baton, baton->config,
pool));
SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url,
pool));
- SVN_ERR(with_locked(to_session, do_initialize, baton, pool));
+ if (opt_baton->using_external_locking)
+ {
+ SVN_ERR(do_initialize(to_session, baton, pool));
+ }
+ else
+ {
+ SVN_ERR(with_locked(to_session, do_initialize, baton, pool));
+ }
return SVN_NO_ERROR;
}
@@ -1276,7 +1290,14 @@
SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
&(baton->sync_callbacks), baton, baton->config,
pool));
SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url,
pool));
- SVN_ERR(with_locked(to_session, do_synchronize, baton, pool));
+ if (opt_baton->using_external_locking)
+ {
+ SVN_ERR(do_synchronize(to_session, baton, pool));
+ }
+ else
+ {
+ SVN_ERR(with_locked(to_session, do_synchronize, baton, pool));
+ }
return SVN_NO_ERROR;
}
@@ -1433,7 +1454,14 @@
SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
&(baton->sync_callbacks), baton, baton->config,
pool));
SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url,
pool));
- SVN_ERR(with_locked(to_session, do_copy_revprops, baton, pool));
+ if (opt_baton->using_external_locking)
+ {
+ SVN_ERR(do_synchronize(to_session, baton, pool));
+ }
+ else
+ {
+ SVN_ERR(with_locked(to_session, do_synchronize, baton, pool));
+ }
return SVN_NO_ERROR;
}
@@ -1664,6 +1692,10 @@
if (err)
return svn_cmdline_handle_exit_error(err, pool, "svnsync:
");
break;
+
+ case svnsync_opt_using_external_locking:
+ opt_baton.using_external_locking = TRUE;
+
case svnsync_opt_version:
opt_baton.version = TRUE;
break;
**********************************************************************
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.
If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
Cabot Communications Limited
Verona House, Filwood Road, Bristol BS16 3RY, UK
+44 (0) 1179584232
Co. Registered in England number 02817269
Please contact the sender if you believe you have received this email in error.
**********************************************************************
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
RE: [PATCH] Add svnsync --use-external-locking option
Posted by Jon Foster <Jo...@cabot.co.uk>.
Hi,
Stefan Sperling wrote:
> On Fri, Nov 27, 2009 at 04:14:08PM -0000, Jon Foster wrote:
> > Add --using-external-locking option to svnsync.
> Hi Jon,
>
> I've finally found time to take a look at this. Sorry for taking so
> long. I have committed your patch in r910212, with some tweaks.
Thankyou for this!
Apache now has an ICLA from me and a CCLA from my employer, which
means that the legal side is (finally) sorted.
Kind regards,
Jon
**********************************************************************
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.
If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
Cabot Communications Limited
Verona House, Filwood Road, Bristol BS16 3RY, UK
+44 (0) 1179584232
Co. Registered in England number 02817269
Please contact the sender if you believe you have received this email in error.
**********************************************************************
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Re: [PATCH] Add svnsync --use-external-locking option
Posted by Stefan Sperling <st...@elego.de>.
On Fri, Nov 27, 2009 at 04:14:08PM -0000, Jon Foster wrote:
> Hi,
>
> As discussed on this list, we don't always need svnsync's networked
> lock. If svnsync only runs on a single server, the administrator
> can use the "flock" tool to prevent running multiple copies of
> svnsync at the same time.
>
> And if svnsync's lock is not needed, then it is actually an
> inconvenience. E.g. if the network connection fails, then a stale
> lock can be left behind. This requires manual administrator
> intervention to fix.
>
> One workaround is for your scripts to run this command immediately
> before they start svnsync:
> svn propdel svn:sync-lock --revprop -r0 $target_url
>
> However, it would be better to provide a command-line option to
> disable svnsync's locking. So, here's a patch to do that.
>
> The option name has been chosen to try to make it obvious that no
> locking is a bad idea, and administrators should either use
> svnsync's internal locking or have their own external locking.
>
> [[[
> Add --using-external-locking option to svnsync.
>
> * subversion/svnsync/main.c
> (svnsync__opt): Add svnsync_opt_using_external_locking.
> (SVNSYNC_OPTS_DEFAULT): Add svnsync_opt_using_external_locking.
> (svnsync_options): Add entry for --using-external-locking.
> (opt_baton_t): Add using_external_locking member.
> (initialize_cmd, synchronize_cmd, copy_revprops_cmd): Don't take the
> lock if using external locking.
> (main): Handle svnsync_opt_using_external_locking option.
>
> Patch by: Jon Foster <Jo...@cabot.co.uk>
> ]]]
Hi Jon,
I've finally found time to take a look at this. Sorry for taking so long.
I have committed your patch in r910212, with some tweaks.
Just so you know what the tweaks were:
> Index: subversion/svnsync/main.c
> ===================================================================
> --- subversion/svnsync/main.c (revision 884900)
> +++ subversion/svnsync/main.c (working copy)
> @@ -61,6 +61,7 @@
> svnsync_opt_sync_password,
> svnsync_opt_config_dir,
> svnsync_opt_config_options,
> + svnsync_opt_using_external_locking,
I've renamed this option to --disable-locking. Matter of taste, really.
> svnsync_opt_version,
> svnsync_opt_trust_server_cert,
> svnsync_opt_allow_non_empty,
> @@ -76,7 +77,8 @@
> svnsync_opt_sync_username, \
> svnsync_opt_sync_password, \
> svnsync_opt_config_dir, \
> - svnsync_opt_config_options
> + svnsync_opt_config_options, \
> + svnsync_opt_using_external_locking
You've added the option as a global option for all subcommands.
I've made the option specific to the 'init', 'sync', and 'copy-revprops'
subcommands instead. It's not useful with other subcommands.
>
> static const svn_opt_subcommand_desc2_t svnsync_cmd_table[] =
> {
> @@ -180,6 +182,10 @@
> "For example:\n"
> " "
> " servers:global:http-library=serf")},
> + {"using-external-locking", svnsync_opt_using_external_locking, 0,
> + N_("Disable built in locking. You must ensure that\n"
> + " "
> + "no other instance of svnsync is running.")},
I've tweaked the help text a bit, to make clear that the mirror
can get corrupted if this option is used and nothing is done
to avoid running multiple instances of svnsync in parallel.
> {"version", svnsync_opt_version, 0,
> N_("show program version information")},
> {"help", 'h', 0,
> @@ -201,6 +207,7 @@
> const char *sync_password;
> const char *config_dir;
> apr_hash_t *config;
> + svn_boolean_t using_external_locking;
> svn_boolean_t quiet;
> svn_boolean_t allow_non_empty;
> svn_boolean_t version;
> @@ -798,7 +805,14 @@
> SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
> &(baton->sync_callbacks), baton, baton->config, pool));
> SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
> - SVN_ERR(with_locked(to_session, do_initialize, baton, pool));
> + if (opt_baton->using_external_locking)
> + {
We don't require braces around single-line if-blocks, so I've removed them.
> + SVN_ERR(do_initialize(to_session, baton, pool));
> + }
> + else
> + {
> + SVN_ERR(with_locked(to_session, do_initialize, baton, pool));
> + }
>
> return SVN_NO_ERROR;
> }
> @@ -1276,7 +1290,14 @@
> SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
> &(baton->sync_callbacks), baton, baton->config, pool));
> SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
> - SVN_ERR(with_locked(to_session, do_synchronize, baton, pool));
> + if (opt_baton->using_external_locking)
> + {
> + SVN_ERR(do_synchronize(to_session, baton, pool));
> + }
> + else
> + {
> + SVN_ERR(with_locked(to_session, do_synchronize, baton, pool));
> + }
>
> return SVN_NO_ERROR;
> }
> @@ -1433,7 +1454,14 @@
> SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
> &(baton->sync_callbacks), baton, baton->config, pool));
> SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
> - SVN_ERR(with_locked(to_session, do_copy_revprops, baton, pool));
> + if (opt_baton->using_external_locking)
> + {
> + SVN_ERR(do_synchronize(to_session, baton, pool));
> + }
> + else
> + {
> + SVN_ERR(with_locked(to_session, do_synchronize, baton, pool));
> + }
This bit you added here is calling the wrong function.
It should call do_copy_revprops(), not do_synchronize().
>
> return SVN_NO_ERROR;
> }
> @@ -1664,6 +1692,10 @@
> if (err)
> return svn_cmdline_handle_exit_error(err, pool, "svnsync: ");
> break;
> +
> + case svnsync_opt_using_external_locking:
> + opt_baton.using_external_locking = TRUE;
> +
You've missed adding a 'break;' here. I've fixed this.
> case svnsync_opt_version:
> opt_baton.version = TRUE;
> break;
Thanks for the patch!
Stefan