You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Hari Kodungallur <hk...@gmail.com> on 2005/07/18 05:39:22 UTC

detecting move and copy

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: detecting move and copy

Posted by Hari Kodungallur <hk...@gmail.com>.
I never thought about the svn log -v option. Thats something we might
be able to use I think

Thanks much!

-Hari
SpikeSource Inc.

On 7/19/05, David Weintraub <qa...@gmail.com> wrote:
> 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.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: detecting move and copy

Posted by David Weintraub <qa...@gmail.com>.
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 <hk...@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 <qa...@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 <hk...@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


Re: detecting move and copy

Posted by Hari Kodungallur <hk...@gmail.com>.
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 <qa...@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 <hk...@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
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: detecting move and copy

Posted by David Weintraub <qa...@gmail.com>.
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 <hk...@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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> 


-- 
--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org