Jump to content


Perforce move operation with no effect in histroy.

P4 move

  • Please log in to reply
23 replies to this topic

#21 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 727 posts

Posted 21 October 2018 - 02:29 AM

View PostNaveen kumar pet, on 20 October 2018 - 10:19 AM, said:

Last paragraph in your comment confuse me :)

It's what you said in your original post, and it confused me too!  :)  In an earlier post you said that if you moved a file, when you synced to an old version things wouldn't work because the build config was pointing at the new file:

Quote

i will sync the file to cl#96 which will place the file in older location in my client. Now i trigger build to verify same. Our build scripts are referring to new path and breaks the build right?


That doesn't make sense to me because when you sync to an old version you should also have the old version of the build config.

Quote

We will do source file movement and build config changes at the same time. I mean we will submit both at one with single change list Suppose lets consider the submission cl of both moved files and build config changes is cl#100. If any one wants to work on older revision of files syncing the client to cl#99 should not help?

It *should* work perfectly.  Does it not?  (And if it does work, what was your earlier question even about?)

#22 Naveen kumar pet

Naveen kumar pet

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 25 October 2018 - 04:08 AM

Hi Member,

I am able to do file movement & other operations successfully :)
But when i try to integrate changes from one branch (with moved files) to other branch. I am not seeing the files getting moved in target branch.

Steps which i did:-
1) Created new branch from mainline with branch spec below
     p4 branch -o priv_branch
     //depot/vip/src/main/cvip/lib/... //depot/vip/src/branches/new_base_branch/src/main/cvip/lib/...
      //depot/vip/src/main/cvip/maker/... //depot/vip/src/branches/new_base_branch/src/main/cvip/maker/...
      //depot/vip/src/main/cvip/*  //depot/vip/src/branches/new_base_branch/src/main/cvip/*
2) Ran command 'p4 integ -b priv_branch' and submitted all opened files in perforce.
3) In private branch 'new_base_branch' which i created in setp2. i moved folders /lib , maker/ folders to /base. After movement, Folder structure becomes :
      //depot/vip/src/branches/new_base_branch/src/main/cvip/base/lib/...
      //depot/vip/src/branches/new_base_branch/src/main/cvip/base/maker/...
      //depot/vip/src/branches/new_base_branch/src/main/cvip/*
4) Now i want that folder movement to effect in my mainline branch. For that i did reverse integration using same branch spec in step1
     p4 integ -b priv_branch -r

When i run above command i can only see the files under cvip/ (cvip/*) in private branch  are getting integrated to mainline branch.
I am expecting to create base/ in mainline branch and move lib/ & maker/ folders in mainline branch when we do 'p4 integ -b priv_branch -r'.

Am i missing something here? Do we need to update branch sepc ? It's not required right? Perforce should understand that files are moved in source branch and if we do integrate from source branch those movement should also effect to target branch right ?

#23 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 727 posts

Posted 25 October 2018 - 05:35 PM

If you move files within a branch, then integration to other branches will pick up the moves, but in this case you've moved the files outside of the branch (the "base" path isn't part of your branch spec), so an integration operation from that branch doesn't include them.  The fix is to expand the branch view when you move the files, like this:

//depot/vip/src/main/cvip/base/... //depot/vip/src/branches/new_base_branch/src/main/cvip/base/...
//depot/vip/src/main/cvip/lib/... //depot/vip/src/branches/new_base_branch/src/main/cvip/lib/...
//depot/vip/src/main/cvip/maker/... //depot/vip/src/branches/new_base_branch/src/main/cvip/maker/...
//depot/vip/src/main/cvip/*  //depot/vip/src/branches/new_base_branch/src/main/cvip/*

Or you could just have the branch include the whole cvip folder:


//depot/vip/src/main/cvip/...  //depot/vip/src/branches/new_base_branch/src/main/cvip/...

The same applies to client views -- if you move a file such that it's no longer mapped in another client, that client's view will need to be updated to map the new path.  (This is never a problem with your own client since you can't move the file in the first place if the target isn't in your view -- it's also not a problem with streams because the branch view and client view are both generated from the same set of Paths that must necessarily include both parts of the move operation.)

#24 Naveen kumar pet

Naveen kumar pet

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 26 October 2018 - 04:47 AM

>> If you move files within a branch, then integration to other branches will pick up the moves
  I did same thing right? I made movement in one private branch 'new_base_branch' and I tried integrating changes from private branch to main branch (mainline branch)

Updating branch spec above followed by 'p4 resolve -am' works as expected :) , Thanks!  

BTW, We want only some specific folders under cvip/ to integrate. So ,updating branch spec with 'cvip/...' wont help us :)





Also tagged with one or more of these keywords: P4 move

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users