You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Paul Dugas <pa...@dugas.cc> on 2005/09/19 18:49:42 UTC
Feature Request: Identify new "copy" entries from pre-commit hook
Hi all,
I want to be able to identify new entries being added to a repository that
are copies, rather than just straight adds, from within a pre-commit hook.
I posted a question to this list looking for help but only got "me too"
responses. I was about to enter it as a feature request in the issue
tracker. Figured I'd post one more time.
I'm trying to enforce some rules on the layout of my repository. I want
to make sure entries in /tags are copyies of /trunk. I want to make sure
entries in /branches are copies of entries in /tags. I want to prevent
users from using mkdir/add to create these new entries instead.
One suggestion was to compare the output of "svn log" with and without
--stop-on-copy but this only works after the transaction has been
completed. I want to do something similar but in the pre-commit hook. I
cannot find similar functionality in "svnlook -t#".
I'm open to other suggestions. If there are none, I'm looking for someone
on the development side to say I should submit this as an issue.
Thanks in advance,
Paul
--
Paul Dugas, Computer Engineer Dugas Enterprises, LLC
paul@dugas.cc phone: 404-932-1355 522 Black Canyon Park
http://dugas.cc fax: 866-751-6494 Canton, GA 30114 USA
--
Onsite at GDOT W.Annex 404-463-2860 x199
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Feature Request: Identify new "copy" entries from pre-commit
hook
Posted by Paul Dugas <pa...@dugas.cc>.
On Wed, September 21, 2005 9:17 pm, Christopher Ness wrote:
> On Wed, 2005-09-21 at 17:20 -0400, Paul Dugas wrote:
>> On Mon, September 19, 2005 7:50 pm, Christopher Ness wrote:
>> > svnlook changed /full/path/to/repos | grep ^C
>>
>> Can't seem to make svnlook produce lines with a leading 'C'. Where did
>> you see this? I looked through the code and don't see where svnlook
>> would
>> do this.
>
> Hi Paul,
>
> My mistake, I should have taken a look at the output from `svn help
> status` and seen that 'C' is a conflict state.
No worries. I looked at the code for svnlook and it looks like it'd be
simple to copy the code for the "changed" subcommand and make a new
"copied" subcommand that listed new entries created as copies of others.
I wonder if this is something that would be useful to others? It
certainly would be to me. I think I'll try it and submit a patch.
Paul
--
Paul Dugas, Computer Engineer Dugas Enterprises, LLC
paul@dugas.cc phone: 404-932-1355 522 Black Canyon Park
http://dugas.cc fax: 866-751-6494 Canton, GA 30114 USA
--
Onsite at GDOT W.Annex 404-463-2860 x199
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Feature Request: Identify new "copy" entries from pre-commit
hook
Posted by Christopher Ness <ch...@nesser.org>.
On Wed, 2005-09-21 at 17:20 -0400, Paul Dugas wrote:
> On Mon, September 19, 2005 7:50 pm, Christopher Ness wrote:
> > svnlook changed /full/path/to/repos | grep ^C
>
> Can't seem to make svnlook produce lines with a leading 'C'. Where did
> you see this? I looked through the code and don't see where svnlook would
> do this.
Hi Paul,
My mistake, I should have taken a look at the output from `svn help
status` and seen that 'C' is a conflict state.
This is such a grave error I need to be embarrassed on list as well so
people don't actually waste time trying this.
I guess you can only enforce the fact that no modifications can be made
in a tag since there is no designation between a copy and an add AFAIK.
Sorry,
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Feature Request: Identify new "copy" entries from pre-commit
hook
Posted by Christopher Ness <ch...@nesser.org>.
On Mon, 2005-09-19 at 14:49 -0400, Paul Dugas wrote:
> Hi all,
>
> I want to be able to identify new entries being added to a repository that
> are copies, rather than just straight adds, from within a pre-commit hook.
> I posted a question to this list looking for help but only got "me too"
> responses. I was about to enter it as a feature request in the issue
> tracker. Figured I'd post one more time.
svnlook changed /full/path/to/repos | grep ^C
Does the above or something like it work? Of course this only works on
the server itself, clients cannot run these commands. But since you are
talking in a hook script sense....
> I'm trying to enforce some rules on the layout of my repository. I want
> to make sure entries in /tags are copyies of /trunk. I want to make sure
> entries in /branches are copies of entries in /tags. I want to prevent
> users from using mkdir/add to create these new entries instead.
You should look for more examples of other peoples hook scripts. Mostly
the pre-commit hook scripts. I know there are some posted in the
archives of this list if you dig for them.
Cheers,
Chris
--
PGP Public Key: http://www.nesser.org/pgp-key/
19:46:53 up 8:57, 2 users, load average: 0.03, 0.09, 0.04