#111 "cvs add" for files from different folders and for multi...

WinCvs (90)

"cvs add" for files from different folders and for multiple

References (all resolved by this patch):
Bugs 862393, 475284, 914055, 1055966, 877084, 909616
RFE 460781

The "Add" menu item doesn't work if the selected files come
from different folders. This is "by design".

This issue was discussed several times. This restriction was
built in as a response to bug 862393 and as a precaution
against adding a file/dir to a wrong repository.

The reason for 862393 is that the second, third, ...
commands were issued while the first command is still
running. The essential contribution of this patch is the new
class "CCvsDefaultConsole" that allows synchronized
execution of a cvs command while sending the output to the
console window.

The restriction that more than one folder cannot be added
has been simply disabled. I feel that there is no real reason
for that, since there is no technical difference between
issuing two queued commands and letting the user issue
the two commands one by one. The only difference is

With this patch, the "add" command works:
- in "flat" mode for several files regardless of their position
in the directory tree
- in "structured" mode for multiple folders and/or files

To allow multiple sandboxes in the hierarchy, a separate cvs
command is issued:
- For every folder added
- For every different parent folder for the files added

Multiple files from the same parent folder are combined into
one cvs command.

<begin internal details>

Internally, CvsCmdAdd is called once for each folder and
one time for all selected files. CvsCmdAdd calls launchCvs
once when passed a folder and several times when passed
a file list for each different parent folder for the file list.
Below you'll find the execution tree for adding folders 1, 2
and files 3.txt and 4.txt in structured mode:

| \launchCvs(1)
| \launchCvs(2)
+OnFiles(3.txt, 4.txt)
|\CvsCmdAdd(3.txt, 4.txt)
| \launchCvs(3.txt, 4.txt)

Another execution tree for adding 1\1.txt and 2\2.txt in flat

+OnFiles(1\1.txt, 2\2.txt)
|\CvsCmdAdd(1\1.txt, 2\2.txt)
| +launchCvs(1.txt {in folder 1})
| \launchCvs(2.txt {in folder 2})

I did not look at the other commands - whether it would
make sense to disable the "one folder" restriction for them.
To disable the restriction, the corresponding CvsCmd...
routine must use a CCvsDefaultConsole for its calls to
launchCvs to allow more than one run of cvs without
returning to the main loop.

<end internal details>


  • Kirill Müller

    Kirill Müller - 2005-06-08

    Logged In: YES

    In the first version of the patch, the "Add binary" and "Add
    unicode" commands were disabled when files from more than
    one folder were selected. Fixed by the current patch files. (Only
    BrowseFileView.cpp has changed compared to the first version.)


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks