You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Yakov Lerner <il...@gmail.com> on 2008/04/30 05:17:32 UTC

client-side hooks ? Re: how to artificially create local "Conflicted" state ?

On Wed, Apr 30, 2008 at 1:10 AM, John Niven <jn...@bravurasolutions.com> wrote:
> > -----Original Message-----
>  > From: Yakov Lerner [mailto:iler.ml@gmail.com]
>  > Sent: Tuesday, 29 April 2008 19:20
>  > To: users@subversion.tigris.org; Puneet Lakhina
>  > Subject: Re: how to artificially create local "Conflicted" state ?
>  >
>  > > > How can I artificially create the local "Conflict" state on the
>  > > > working
>  > > file,
>  > > > without doing any checkins on any computer ? Sort of opposite to
>  > > > 'svn resolved'. How ?
>
>  > > I dont think there is a direct way of doing it. This would involve
>  > > some sort of a hack by modifying .svn/entries file for this
>  > particular
>  > > directory. In conflicted state the entries file contains
>  > entries for
>  > > filename.rPREV filename.rHEAD and filename.mine
>  > > >
>  > > > The purpose is to prevent accidental checkin of
>  > temporary/debugging
>  > > > changes in the file. Attempt to checkin should cause svn
>  > error, just
>  > > > like attempt to checkin the file in Conflicted state is refused.
>  > > >
>
> > In Linux/Unix, I do have a solution for protecting from
>  > accidental checkin -- I make local file to a become symlink
>  > -- then 'svn ci' dies with "Special state changed" error.
>  > That's nice trick.
>  >
>  > But On Windows  .. on windows I am still searching for the solution.
>  >
>  > The hacking the .svn/entries you mentioned looks promising,
>  > I'll investigate it.
>
>  I'm surprised other people haven't haven't cautioned you about hacking
>  /svn/entries, but it sounds like a horrible way to quickly mess up your
>  working copy.
>
>  Another approach might be to have a pre-commit hook that checked for the
>  existence of a certain string, and blocked the commit if the string was
>  present in a file.  Then you could add the string to the beginning of
>  any file you were debugging, something like
>  "//__DEBUGGING__DO_NOT_COMMIT__".  Human- and machine-readable, so very
>  clear to anyone what it does.  You'd possibly want to have the hook
>  script only check the first line of each file, so as not to slow down
>  commits too much.

Yep, for those who can modify the server, this is possible solution.

I do not have access to the server other than checkin/checkout.
I am looking for client-only solution. If svn had client-side hooks
though ......

It would be nice if svn had client-side hooks btw, would be helpful.
Any plans to add client-side hooks to svn ?

Thanks
Yakov

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

Re: client-side hooks ? Re: how to artificially create local "Conflicted" state ?

Posted by Hari Kodungallur <hk...@gmail.com>.
On Tue, Apr 29, 2008 at 10:17 PM, Yakov Lerner <il...@gmail.com> wrote:

> On Wed, Apr 30, 2008 at 1:10 AM, John Niven <jn...@bravurasolutions.com>
> wrote:
> > > -----Original Message-----
> >  > From: Yakov Lerner [mailto:iler.ml@gmail.com]
> >  > Sent: Tuesday, 29 April 2008 19:20
> >  > To: users@subversion.tigris.org; Puneet Lakhina
> >  > Subject: Re: how to artificially create local "Conflicted" state ?
> >  >
> >  > > > How can I artificially create the local "Conflict" state on the
> >  > > > working
> >  > > file,
> >  > > > without doing any checkins on any computer ? Sort of opposite to
> >  > > > 'svn resolved'. How ?
> >
> >  > > I dont think there is a direct way of doing it. This would involve
> >  > > some sort of a hack by modifying .svn/entries file for this
> >  > particular
> >  > > directory. In conflicted state the entries file contains
> >  > entries for
> >  > > filename.rPREV filename.rHEAD and filename.mine
> >  > > >
> >  > > > The purpose is to prevent accidental checkin of
> >  > temporary/debugging
> >  > > > changes in the file. Attempt to checkin should cause svn
> >  > error, just
> >  > > > like attempt to checkin the file in Conflicted state is refused.
> >  > > >
> >
> > > In Linux/Unix, I do have a solution for protecting from
> >  > accidental checkin -- I make local file to a become symlink
> >  > -- then 'svn ci' dies with "Special state changed" error.
> >  > That's nice trick.
> >  >
> >  > But On Windows  .. on windows I am still searching for the solution.
> >  >
> >  > The hacking the .svn/entries you mentioned looks promising,
> >  > I'll investigate it.
> >
> >  I'm surprised other people haven't haven't cautioned you about hacking
> >  /svn/entries, but it sounds like a horrible way to quickly mess up your
> >  working copy.
> >
> >  Another approach might be to have a pre-commit hook that checked for
> the
> >  existence of a certain string, and blocked the commit if the string was
> >  present in a file.  Then you could add the string to the beginning of
> >  any file you were debugging, something like
> >  "//__DEBUGGING__DO_NOT_COMMIT__".  Human- and machine-readable, so very
> >  clear to anyone what it does.  You'd possibly want to have the hook
> >  script only check the first line of each file, so as not to slow down
> >  commits too much.
>
> Yep, for those who can modify the server, this is possible solution.
>
> I do not have access to the server other than checkin/checkout.
> I am looking for client-only solution. If svn had client-side hooks
> though ......
>
> It would be nice if svn had client-side hooks btw, would be helpful.
> Any plans to add client-side hooks to svn ?
>
>
I was tempted to say, please take care when you check-in. But I know
mistakes happen and so it is a valid question :-)

Since there are no client-side hooks, you could write some wrappers.

- On Windows, you could use TortoiseSVN to de-select a file in the check-in
pop up window.
- On *nix, you could use some sort of script, something similar to what was
mentioned here:
http://svn.haxx.se/users/archive-2008-04/0093.shtml


Regards,
-Hari

RE: client-side hooks ? Re: how to artificially create local "Conflicted" state ?

Posted by John Niven <jn...@bravurasolutions.com>.
> -----Original Message-----
> From: Yakov Lerner [mailto:iler.ml@gmail.com] 
> Sent: Wednesday, 30 April 2008 17:18
> To: John Niven; users@subversion.tigris.org
> Subject: client-side hooks ? Re: how to artificially create 
> local "Conflicted" state ?
> 
> Yep, for those who can modify the server, this is possible solution.
> 
> I do not have access to the server other than checkin/checkout.
> I am looking for client-only solution. If svn had client-side 
> hooks though ......
> 
> It would be nice if svn had client-side hooks btw, would be helpful.
> Any plans to add client-side hooks to svn ?
> 

I don't know, but since this problem is Windows-only, you could check
out TortoiseSVN 1.5, which has client-side hooks.

Cheers
John


> Thanks
> Yakov
> 

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