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

Re: detecting move and copy

From: David Weintraub <qazwart_at_gmail.com>
Date: 2005-07-20 04:14:23 CEST

I did some experimenting, and didn't get very far. If I do a "svn log
-v", I get information that this was a copy. However, you can only use
"svn log -v" on revisions and not transactions. The "svnlook log"
command doesn't take a "-v" option. In fact, I couldn't find any of
the "svnlook" commands that would give me the information (and you
would need to do an "svnlook" to be able to stop the commit).

The best you can do is a post-commit trigger that looks at the "svn
log -v" command output to see if this was in fact a copy and not a
mkdir. If it was a "mkdir", you could send out an email to yourself,
so you could have a log talk with the culprit. You could then move the
offending branch to another directory and clean up the mess.

It won't prevent someone from making a branch they're not suppose to,
but it will alert you when it does happen and allow you to fix the
problem and let the person who did this know they've done you wrong.

On 7/18/05, Hari Kodungallur <hkodungallur@gmail.com> wrote:
> David, Thanks for you response.
> We have a couple of branch directories. One of them should only be
> holding release branches and nothing else and other can hold any
> branch.
> Obviously, we do not want to have spurious branch creations on the
> release branch tree. We could write a hook that looks for directory
> additions (but as you point out, it does not tell you whether it was
> svn add or a svn mkdir or a svn copy) or we could restrict the branch
> creations in the release tree to only a a couple of users.
> This is not a pressing need for us. But I was curious to know whether
> there is a way for the svn server to know whether the incoming request
> is a "svn copy/move" (that is whether it is an Addition with history)
>
> Thanks
> -Hari
>
>
> On 7/18/05, David Weintraub <qazwart@gmail.com> wrote:
> > Exactly what do you need to do this for?
> >
> > Are you allowing people to create tags, but not modify existing tags?
> > I have a hook script that can do that.
> >
> > Basically, I'm simply looking for "adds" from the "svnlook changed"
> > command. Of course, this could have easily be done via an "svn mkdir"
> > or "svn add" command too.
> >
> > Hmmm... Maybe check the "svnlook changed" to find candidate
> > copy/moves, then do an "svn log --stop-on-copy" and compare the output
> > to "svn log" to see if they are different?. You can't use "svnlook
> > log" since it doesn't have the --stop-on-copy option.
> >
> > On 7/18/05, Hari Kodungallur <hkodungallur@gmail.com> wrote:
> > > Hi,
> > >
> > > Is there a way to detect a move or copy at the svn server using the
> > > svnlook command (or any other command)?
> > >
> > > Thanks
> > > -Hari
> > >
> > --
> > David Weintraub
> > qazwart@gmail.com
> >
>

-- 
--
David Weintraub
qazwart@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jul 20 04:16:42 2005

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

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