[p4] Confused by 'p4 integrate' behavior.
sandy currier
sandy at releng.com
Fri Oct 6 02:24:14 PDT 2006
It is still possible for Perforce to support deletes without
necessarily versioning directories. Our enhancement requests for
this have been under the title of "support resolve-able deletes", as
Steve has referenced below.
The main point is to allow deletes and edits (and adds) to be
able to be resolved at resolve time instead of integrate time. In the
case where there is no target file to begin with, Perforce would need
to support version #1 of a file being an action something other than
an add or a branch - specifically a delete in this case. The resolved
delete data could be stored as a (almost) normal integration record
ClearCase supports merging deletes with versioned directories, which
though nice, does create usage artifacts. AccuRev supports this
without versioned directories, and the usability is quite nice.
For example, when resolving a delete against an edit, one effectively
gets a "do you want to accept this delete" prompt. When resolving a
file name change, one effectively gets a "do you want to accept this
name change" before one gets to the effective "accept theirs, yours,
etc." content prompt. Perforce could do the same with deletes by
say scheduling a pending 'delete' resolve for that file.
I personally think that if Perforce were to support resolve-able
deletes, Perforce too would have nice usability in this area
(hint hint).
-sandy
The problem is that there is no place in the current Perforce database
to store these decisions. For example, what if I have a file in my
source branch, but not my target branch? Let's say this happened because
I deleted that file from my target branch. The first time through, I
somehow tell Perforce "Do not add this file to my target branch". Where
does Perforce store this information? It can't store it in the target
file because there is no file in my target branch. That's why we
manually have to modify the branchspec to store this information.
Maybe what we may need is an "internal branchspec". That is, when we
tell Perforce "don't add this file", this internal branchspec could keep
track that we don't want to add this file. Then, Perforce will know the
next time not to attempt to delete or add this file.
In fact, if this internal branchspec could be versioned like a file, it
could even anticipate our responses. Let's take the missing file in my
target branch. This could be for one of two reasons (okay, there's more
than two, but we'll consider two for now): I could have removed the file
from my target branch or I could have added the file to my source
branch.
Let's take the first case, and say I removed the file from my target
branch. Perforce would examine the internal branchspec, see that there
is a new version of this branchspec since the last integration, and see
that this file was deleted. It could then know, without even asking me,
that I don't want this file readded when I again integrate from the
source branch to the target branch.
Let's take the second case, and I added the file to my source branch.
Perforce would examine the branchspec, see that the file was never in my
target branch, and ask if I want to add the file. When I say "no",
Perforce would track that decision in the internal branchspec, create a
new version of the internal branchspec with that decision, and never ask
me again.
All we are now missing is a way to move files and be able to track the
move. Right now, we actually do a copy and delete which isn't quite the
same. Let's say we actually have a "move/rename" command:
$ p4 mv foo.cpp bar.cpp
Now, my internal branchspec can actually track the move (just like you
would with your current branchspec). Next time I integrate, my internal
branchspec will let the integrate command know that the file foo.cpp in
my source branch should integrate with file bar.cpp in my target branch.
Would this work?
-----Original Message-----
From: Stephen Vance [mailto:steve at vance.com]
Sent: Tuesday, October 03, 2006 4:19 PM
To: Weintraub, David
Cc: Krzysztof Kozminski; perforce-user at perforce.com
Subject: Re: [p4] Confused by 'p4 integrate' behavior.
Full directory versioning is not necessary to solve this issue. Simple
ability to accept yours or accept theirs for deletes and adds is
sufficient. The file-based versioning can be made to handle it without
all the complexity of directory versioning (e.g. accept yours when
integrating a branch/add gives a #1 version that is a delete).
The only thing directory versioning solves is the empty directory
problem. Even rename issues can be solved without that.
Steve
More information about the perforce-user
mailing list