About IBranchingVC...

Andreas Pakulat apaku at gmx.de
Thu May 17 20:39:59 UTC 2007


On 17.05.07 14:24:26, Matthew Woehlke wrote:
> How exactly is branch() supposed to work? In perforce, a "tag" (label) 
> requires the source files to be checked out, while a branch() requires 
> the destination to be in the view (branch() == copy() except somewhat 
> more sophisticated). Also there is a "branch" object that would 
> (should?) be created in this case. Also labels in perforce need a name 
> (no surprise here).

Yes, tag needs two QString arguments (and the 2nd is implementation
specific, in svn a repo path, in cvs or p4 a simple string).

> In svn AFAIK both branch() and tag() are synonyms for copy().

Right.

> I don't know how things work in CVS.

Reading the manual tag == branch, more or less. Just that tag is just a
label for a specific revision and branch is something that you can
create new revisions in without interfering the originating branch.

> Options:
> - move branch() to IRepositoryVC and drop tag()

tag() is if I see this correctly usable on simple files in cvs. In fact
brach == tag with a special flag on cvs (I'm looking into the handbook).
So branch creates a branch for the current working copy. Its also
possible to do this remote-only by specifying the module that does this.

> - perforce doesn't implement IBranchingVC
> - clarify what branch() and tag() do in a way that is favorable to a 
> perforce implementation

Ok, how about this:

branch() takes either a working copy or remote path and creates a branch
for that in a target path or with a target name. Or does p4 need a
mapping here too, i.e. something like
foo/bar->foo/branch1/bar
boo->foo/branch1/boo

tag() is really just a label for a combination of a working copy or
remote path + a specific revision. So it would take 2 QVariant
arguments, the first being a repo or local path and the 2nd either a
path or a label.

> - drop IBranchingVC altogether; plugins will expose the VCS's native flavor

Looking at the above you always have to know which VCS you deal with, so
I guess this is the option to go. VCS' can provide their own interface
if they want to allow scripted branch creation. I do think we could
provide showBranch() and showTag() for example in the IRepositoryVC, how
does that sound?

> - something else?
> 
> In any case, "branches" can still be done using copy() from IBasicVC for 
> the generic case

Well, for CVS a branch is just a tag to which you can commit, so the 2nd
argument to copy would be the branch name for this.

> NOTE: Shouldn't copy(), etc in IRepositoryVC take lists?

svn doesn't allow that, does perforce allow to copy individual files in
1 commit to a directory? Something like copy foo bar dest/ (for CVS we
don't care, that one has no copy builtin so its always a plain copy+add)

Andreas

-- 
A tall, dark stranger will have more fun than you.




More information about the KDevelop-devel mailing list