On Wed, Jun 11, 2008 at 3:00 PM, Ryan Schmidt <
subversion-2008b_at_ryandesign.com> wrote:
> On Jun 11, 2008, at 01:36, Jeenu V wrote:
>
> I'm wondering whether there's a means by which I can prevent myself from
>> an accidental commit, from a particular directory in my working copy. Most
>> of the times, I do an "svn ci" from a top-level directory, oblivious about a
>> not-ready-to-commit change in some of the sub-directories. I realize the
>> mistake mostly when I see the "sending ..." messages from the commit
>> command.
>>
>> I thought I could use the "svn lock" but, IIUC, that only prevents others
>> from making commits. I was thinking of some client-side hooks to assist me,
>> and AFAIK, that's not supported by SVN.
>>
>
> Right, "svn lock" is not applicable, and there are no client-side hooks.
>
> The correct solution is probably to look at the output of "svn status" and
> "svn diff" and make sure that you really want to commit all shown
> differences. Only then should you run "svn commit".
>
In addition to "svn st" and "svn diff", I also suggest that you don't do the
commit with the commit message already in the command line. Force it to open
the editor. In the editor you can see the files that it will commit. You can
not modify the file list in the editor, but if you see anything in there
that you don't want to commit, you have the option of quitting the editor
without making any changes. Which in turn gives you an option of aborting
the commit.
regards,
-Hari
Received on 2008-06-12 00:21:17 CEST