[p4] view code from multiple branches

Kamlesh Mutha mkamlesh at gmail.com
Mon Aug 3 07:24:59 PDT 2009


Just to clarify, let me correct the typo first:

My requirement is:

1. I have a branch //depot/main/...
2. I fork off a new branch //depot/itr/... from //depot/main
3. I want to have a workspace in which I should be able to see following
files
    a. All files modified on //depot/itr branch
    b. For a file which is not modified on //depot/itr/..., the latest
revision from //depot/main/... branch.

Why is it needed ?

/itr branch is a private branch and developer is working on some
development. While he is working on private branch and main branch is
changing (for the planned development). The developer should be able to see
those changes in a workspace along with his own changes to ensure that both
changes together still build/function fine. Intention is to avoid major
surprise just after integrating private branch in main.

I know, perforce recommends that you keep on rebasing your private branch by
integrating changes from main to private but that involves "integration" and
people sometimes find it pretty difficult. Hence I wanted to check if this
can be handled through some special purpose workspace.

Thanks and Regards,
Kamlesh






On Mon, Aug 3, 2009 at 7:37 PM, Stephen Vance <steve at vance.com> wrote:

> You may want to look at Sandy Currier's p5 tools to support sparse
> branches. I think you can get them from his web site at releng.com. It can
> be done manually, as well, but it's not the most natural workflow in
> Perforce.
>
> What is your motivation for wanting sparse branches?
>
> Generally, the reasons for wanting sparse branches in Perforce are a)
> wanting a workflow similar to that of another SCM system, b) avoidance of
> merging, or c) a large code base with a large user community and an
> aggressive branching model.
>
> For a), you just need to recognize that different SCM systems do things
> different ways and most of them are correct and consistent models, but few
> of them support all workflows. Changing tools often requires changing
> workflows. The Perforce model is full branching and the overhead for a
> branch is pretty light. Unless you fall in to the category described in (c),
> don't fight the tool.
>
> For b), I can only say that Perforce has excellent merging support and that
> you will create more problems trying to avoid merging than you would save.
> Define a planned branch strategy rather than letting it happen in an
> uncontrolled manner and make sure people have the right training.
>
> For c), you may need to make some extra efforts to keep your db sizes in
> check. Tools like the p5 tool set and planning for product and project
> componentization to facilitate more local branching will take you a long
> way. Very few organizations fall into this category, however.
>
> Steve
>
>
> Kamlesh Mutha wrote:
>
>> Hi All,
>>
>> Can someone please let me know if the following is possible in perforce
>> and
>> how?
>>
>> 1. I have a branch //depot/main/...
>> 2. I fork off a new branch //depot/itr/... from //depot/main
>> 3. I want to have a workspace in which I should be able to see following
>> files
>>                a. All files modified on //depot/itr branch
>>                b. For a file which is not modified on //depot/itr/..., the
>> latest revision from //ars/main/... branch.
>>
>> Thanks,
>> Kamlesh.
>>
>>
>>
>>
>
> --
> Stephen Vance
> www.vance.com
>
>


-- 
Faith waiting in the heart of a seed promises a miracle of life which it can
not prove!
-Ravindranath Tagore



More information about the perforce-user mailing list