Jump to content


Merging one changelist into multiple locations

integrate merge p4v branch

  • Please log in to reply
3 replies to this topic

#1 jamesh

jamesh

    Member

  • Members
  • PipPip
  • 18 posts

Posted 26 April 2018 - 12:50 PM

Hi,

We've got a depot hierarchy that goes something a bit like this:

//depot/dev
//depot/rel/1.0
//depot/rel/2.0
//depot/rel/3.0
...

In general, we make changes to the dev location, and every so often create a new release branch by branching dev to the desired location. However, sometimes, we have to make changes to all of our branches. So, we make the change in dev, and then use merge/integrate to merge the change from dev into each branch separately.

I was wondering if there was a way to merge from one location into multiple locations at the same time, without having to do lots of separate merge commands? I know that branch mappings exist, but when I try to do something like this:

//depot/dev/... //depot/rel/1.0/...
//depot/dev/... //depot/rel/2.0/...
//depot/dev/... //depot/rel/3.0/...

Only the last of these is actually integrated, so obviously this isn't quite the way to do it. Can anybody provide a better way than having to do it separately for each one?

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 957 posts

Posted 26 April 2018 - 04:57 PM

It's not possible to do this from P4V without making a custom tool.

From the command line it's pretty simple.  Since it sounds like you've already made the list of the views you want to merge, just put them in a text file (let's call it MULTIVIEW.txt):

//depot/dev/... //depot/rel/1.0/...
//depot/dev/... //depot/rel/2.0/...
//depot/dev/... //depot/rel/3.0/...

and then I believe you can do something like:

p4 -x MULTIVIEW.txt run merge

Failing that, xargs is your friend.  :)

#3 p4rfong

p4rfong

    Advanced Member

  • Staff Moderators
  • 343 posts

Posted 26 April 2018 - 06:27 PM

You can use "ditto" mappings where a file is mapped to multiple locations.  So one location would be actual and the others would be linked to the original location.
See
https://www.perforce...hlight=mappings

Major new functionality in 2016.1
#1357095 (Bug #5897) * **
    Ditto (&) mappings are now supported in client views.
    These allow a client to map files from the depot into multiple
    locations in the workspace in a one-to-many fashion.
    Files mapped with this flag are read-only, and may not be open by
    'p4 edit', etc. The same files may also be normally mapped, allowing
    a single copy of the file in the workspace to be openable.
    Each sync'ed copy of the same file has it's own have record, and so
    can be sync'ed to a different revision from the other copies of the
    same file. To sync a specific copy of a file, you must specify the
    path in client syntax.
    Existing clients will be able to sync files mapped with ditto
    mappings. In order for 'p4 fstat' to show details about ditto mapped
    files, p4 must either be updated or the '-zexpandAndmaps' global
    flag must be provided.

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 957 posts

Posted 27 April 2018 - 06:21 AM

View Postp4rfong, on 26 April 2018 - 06:27 PM, said:

You can use "ditto" mappings where a file is mapped to multiple locations.  So one location would be actual and the others would be linked to the original location.
See
https://www.perforce...hlight=mappings

Major new functionality in 2016.1
#1357095 (Bug #5897) * **
Ditto (&) mappings are now supported in client views.
These allow a client to map files from the depot into multiple
locations in the workspace in a one-to-many fashion.
Files mapped with this flag are read-only, and may not be open by
'p4 edit', etc. The same files may also be normally mapped, allowing
a single copy of the file in the workspace to be openable.
Each sync'ed copy of the same file has it's own have record, and so
can be sync'ed to a different revision from the other copies of the
same file. To sync a specific copy of a file, you must specify the
path in client syntax.
Existing clients will be able to sync files mapped with ditto
mappings. In order for 'p4 fstat' to show details about ditto mapped
files, p4 must either be updated or the '-zexpandAndmaps' global
flag must be provided.

Last I checked those don't work in branch views (although I might be out of date)...





Also tagged with one or more of these keywords: integrate, merge, p4v, branch

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users