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

[PATCH] Commit directories recursively whenever possible

From: Tobias Schäfer <tobiasschaefer_at_gmx.de>
Date: 2006-03-11 13:49:20 CET

Hi,

currently TSVN does not do a recursive commit even in cases where it would be
possible resulting in "Cannot non-recursively commit a directory deletion".

Assume the following scenario:

Directory structure:
dirA\dirAA
dirA\dirAA\fileAA.txt
dirA\modifed.txt
dirB\dirBB
dirB\dirBB\fileBB.txt

I want to delete dirA/dirAA and dirB/dirBB recursively in one revision. So I
call "svn delete" on these two directories. I have also modifed the file
dirA\modifed.txt which I do not want to commit:

The result is:
D:\wc>svn status
D dirA\dirAA
D dirA\dirAA\fileAA.txt
M dirA\modifed.txt
D dirB\dirBB
D dirB\dirBB\fileBB.txt

I now call the TSVN context menu on d:\wc (or select both dirA and dirB) and
call "Commit" and then deselect dirA\modifed.txt, so that it won't be
committed.

To decide if TSVN sends a recursive commit it uses the following logic:
recursive: no unchecked items
non-recursive: at least one unchecked item.

Because I deselected dirA\modifed.txt TSVN will send a non-recursive commit
which results in the following error reported by the subversion server:
"Cannot non-recursively commit a directory deletion"

IMHO in the scenario above TSVN could have sent a recursive commit. The
algorithm to decide if a recursive commit is possible is too lazy.

I propose the following:
Do a recursive commit, unless there is at least on unchecked item which has an
ancestor which is checked.

This allows the commit of the scenario mentioned above.

btw, the command line client allows this:
svn ci dirA/dirAA dirB/dirBB -m "delete directories"
so TSVN should also support it.

This change will result that a lot of commits will be done recursively instead
of non-recusively. But this shouldn't break anything because it falls back to
non-recursive when needed.

Please review. Ok to commit?

Tobias

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org

Received on Sat Mar 11 13:51:03 2006

This is an archived mail posted to the TortoiseSVN Dev mailing list.

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