Discussion:
Issue a command for more than one folder
kirillmueller
2006-02-27 09:38:26 UTC
Permalink
Hi all,

currently, cvsgui forbids issuing commands for more than one directory
module at once. (Select two or more folders, open context menu, see
almost everything in gray.) Why?

Is it about possibly having distinct CVSROOT's and/or module names for
the folders? Or some "virtual modules" issue whatsoever? What could
happen in the worst case if we allowed this? Wouldn't cvs handle it
properly? If not, what can we do to allow multi-folder selections and
make everything work right?

The same applies to selecting a folder and one or more files.


Regards,

Kirill







Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/cvsgui-dev/

<*> To unsubscribe from this group, send an email to:
cvsgui-dev-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
kaczoroj
2006-02-28 02:13:15 UTC
Permalink
Kirill,
Post by kirillmueller
currently, cvsgui forbids issuing commands for more than
one directory module at once. (snip) Why?
CVS doesn't handle relative paths quite well. It works better for some
commands than for others. We had a lot of reports about failed "cvs
add" in particular. Things can go wrong with commits as well and you
don't want to take your chances here. For multifolder selection the
best so far was issue one command per directory. This is what I am
doing in CvsIn and it works pretty good.

What I would like to have is that CVS would just handle relative paths
properly but no hope in that area I think. The next best thing would
be to run one command per folder. I was hoping to implement such
things after I have "fire-and-forget" in place but I can not find
enought time to do that change now. Fire-and-forget would make that
easy because we would just send per-folder command into the queue and
the background thread would take care about the rest.

It may be possible to implement per-folder even now, but that may
complicate later implementations. However if you really feel like
getting into that (or if you have any better ideas) please go ahead
but be very carefull not to break something ;)

Best Regards,
Jerzy







Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/cvsgui-dev/

<*> To unsubscribe from this group, send an email to:
cvsgui-dev-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
kirillmueller
2006-02-28 06:27:00 UTC
Permalink
Post by kaczoroj
CVS doesn't handle relative paths quite well.
I've read that in discussions before. What does it mean in real life?

Is it that, for a module "Module" located in, say, "C:\Projects", a

(A)
cvs <some-command> Module (in C:\Projects)

differs from

(B)
cvs <some-command> (in C:\Projects\Module)

in function? Or is there another case I'm unable to imagine?

Currently, WinCvs issues the (A) version when a folder is selected.
The command is supposed to use the CVSROOT and module name stored in
C:\Projects\CVS and will fail if C:\Projects is not a sandbox itself
but merely a collection of sandboxes. I don't see (and didn't ever
expierience) a difference between issuing two commands

(A1)
cvs <some-command> Module1 (in C:\Projects)
cvs <some-command> Module2 (in C:\Projects)

and issuing one command

(A2)
cvs <some-command> Module1 Module2 (in C:\Projects)

. Are there bugs in CVS that prevent (A2) from working properly in
all cases?

My point is: If WinCvs uses alternative (A) anyway and this is not
supposed to be changed in the near future, why not allowing (A2) (if
they behave identically)?

We could make it an option like "Smart Sorting" :-) A checkbox
like "Allow multi-folder command" that, when enabled, would hand the
responsibility for bad behavior over to CVS. Disabled by default. If
disabled, a multi-folder command would print a warning to the console
with a reference to above check box.

Another option would be to check the CVSROOTS and module names in
Module1\CVS and Module2\CVS and issue (A2) if they're equal, (A1) if
not.
Post by kaczoroj
It works better for some
commands than for others. We had a lot of reports about failed "cvs
add" in particular. Things can go wrong with commits as well
and you don't want to take your chances here.
But what can possibly go wrong with Diff, Query Update or even
Update?
Post by kaczoroj
For multifolder selection the
best so far was issue one command per directory. This is what I am
doing in CvsIn and it works pretty good.
That would be (A1). It's a "sure shot" but unnecessarily slow in many
(if not most) cases. Again: How could CVS possibly misinterprete
relative paths when using the same CVSROOT and when module names in
the sandbox match those in the repo? I think this is by far the most
frequent case.
Post by kaczoroj
The next best thing would be to run one command per folder. ...
Fire-and-forget would make that
easy because we would just send per-folder command into the queue and
the background thread would take care about the rest.
I've looked at the code around launchCVS -- I see a lot of work to do
for that. All platform-dependent and deadlock-prone...
Post by kaczoroj
It may be possible to implement per-folder even now, but that may
complicate later implementations.
We can have it all easily right now:
- Add a new CCvsConsole child class CDefaultConsole that writes its
output to the console. This, when used, makes calls to ::launchCVS
synchronous.
- Add a class CCvsLauncher with a function launchCVS that takes the
same arguments as the global function. This class will collect the
arguments for multiple CVS runs
- Functions in CvsCommands.cpp that don't care about CVS's result
call a local CCvsLauncher instance's launchCVS function. Minimal
changes to existing code.
- In the destructor, CCvsLauncher launches the collected CVS commands
one by one, using a CDefaultConsole for every command but the last
- When "Fire and forget" is implemented, change CCvsLauncher's
implementation to launch the CVS commands early and not upon
destruction
- Drawback: No commands but "Stop CVS" available while the CVS
commands run; can be changed (at least for WinCvs) by having an own
message pump in ::launchCVS.

What do you think?


Cheers,

Kirill







Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/cvsgui-dev/

<*> To unsubscribe from this group, send an email to:
cvsgui-dev-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
kaczoroj
2006-02-28 22:26:40 UTC
Permalink
Kirill,

Current state of affairs is a result of me gettings tired with closing
the bug reports from people who faced the problems. We can not also
pass the responsibility onto CVS. Current approach is simple and
works, one command per folder is safe, simple and it works too.
Performance hit is minimal anyhow.

Let me put the problem from another perspective: What do we have to
win? Not much. If you rutinely find yourself selecting multiple
folders it means your files placement need re-arranging. You should
work on one change at a time and commit will be from the top-level
folder in 99.9% of the cases. It is even more true now that we can
make a diff when commiting the folders.

Tinkering with that will probably cause a lot of problems until we
iron out all the tricky details. I find it not worth the effort,
really. There is a lot of other things to implement instead.

Best Regards,
Jerzy







Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/cvsgui-dev/

<*> To unsubscribe from this group, send an email to:
cvsgui-dev-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
kirillmueller
2006-03-06 10:28:17 UTC
Permalink
Jerzy,

I do not really agree with you but don't want to deepen the discussion
right now. I'm not missing the feature hard enough yet. By now, I just
want to understand why. Could you please point me to some discussions
in the past that led to WinCvs's current behavior that disallows
commands for multiple folders?

Apart from the questions in my last mail, I don't understand why a
command for files from different folders in flat view is "safe" and the
same command for two folders in the same folder in structured view
is "unsafe". This just doesn't seem logical to me. (Doesn't mean that I
want the former to be disallowed as well :-) )


Regards,

Kirill






Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/cvsgui-dev/

<*> To unsubscribe from this group, send an email to:
cvsgui-dev-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
kaczoroj
2006-03-08 00:09:55 UTC
Permalink
Kirill,

We don't always have to agree on everything. This is why we have this
list - to discuss ;)

There was no discussions per se - just myself trying to stabilize
WinCvs so it behaves correctly and bug reports when it didn't ;) It
works now, and I don't say it's perfect but it does work without
creating too much problems.
I don't understand why a command for files from different
folders in flat view is "safe" and the same command for
two folders in the same folder in structured view is "unsafe".
This is the result of "field testing" done mostly by users. I don't
have time to study each command and discover when and why it works - I
just find the simplest way to make it work. In WinCvs it's to disallow
mixing folders and files. In CvsIn it's one command in each folder. At
some later point in this new development cycle we will have another go
at this - but I don't feel this is the right time. Your recent
improvements are very useful and with any luck we can promote
development version to the status of stable. If we break basic things
now it will not happen for a long time. This is not to discourage you.
In fact you can probably create a brach for that - just so we can see
what code is involved. Perhaps I am over-cautions...
(Doesn't mean that I want the former to be disallowed as well :-) )
Too late - adding files is blocked for selection from different
folders already ;)

In this case the problem was that add must be performed in correct
order or it will fail - it was easier to just disable this function.
We will have to fix it at some point for sure.

Best Regards,
Jerzy








Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/cvsgui-dev/

<*> To unsubscribe from this group, send an email to:
cvsgui-dev-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
kirillmueller
2006-03-18 21:45:22 UTC
Permalink
Jerzy,

thank you for your explanations.

Of course my proposal for "fire and forget" plus allowing multifolder
selections is too much of a change to do just before a "stable"
version. But if a stable version is about to be released, why don't
you create a branch now and limit the changes in that branch to those
that fix regressions (=things that worked in a previous stable
version)? I don't know what CVS server is running at SourceForge --
CVSNT has those branch points, so updating the trunk with each change
in the "stable" branch is fairly easy. -- If there are reasons why
this cannot be done, we can open a new branch.

The reason for me not to deepen the discussion is that I won't be
having time to do that in the near future. I was just curious whether
issuing a command for files from different folders can be
considered "safe". In the absence of floods of bug reports for
commands in flat view, I think we can assume this is the case. Multi-
folder commands would be useful in some cases for me (add,
diff, ...), I would like to find a safe way to enable them.

I've posted a patch that fixes allows multi-folder adds quite a long
time ago. It works well for me and uses a similar design to the one
I've proposed. (It does not add folders, but this could be fixed
easily.)

Next thing to do for me is to improve diff performance for multiple
files.


Kind regards,

Kirill
Post by kaczoroj
Kirill,
We don't always have to agree on everything. This is why we have this
list - to discuss ;)
There was no discussions per se - just myself trying to stabilize
WinCvs so it behaves correctly and bug reports when it didn't ;) It
works now, and I don't say it's perfect but it does work without
creating too much problems.
I don't understand why a command for files from different
folders in flat view is "safe" and the same command for
two folders in the same folder in structured view is "unsafe".
This is the result of "field testing" done mostly by users. I don't
have time to study each command and discover when and why it works - I
just find the simplest way to make it work. In WinCvs it's to
disallow
Post by kaczoroj
mixing folders and files. In CvsIn it's one command in each folder. At
some later point in this new development cycle we will have another go
at this - but I don't feel this is the right time. Your recent
improvements are very useful and with any luck we can promote
development version to the status of stable. If we break basic
things
Post by kaczoroj
now it will not happen for a long time. This is not to discourage you.
In fact you can probably create a brach for that - just so we can see
what code is involved. Perhaps I am over-cautions...
(Doesn't mean that I want the former to be disallowed as well :-
) )
Post by kaczoroj
Too late - adding files is blocked for selection from different
folders already ;)
In this case the problem was that add must be performed in correct
order or it will fail - it was easier to just disable this
function.
Post by kaczoroj
We will have to fix it at some point for sure.
Best Regards,
Jerzy
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/cvsgui-dev/

<*> To unsubscribe from this group, send an email to:
cvsgui-dev-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Loading...