Jump to content


Modify integrated moved/renamed file prior to submission


  • Please log in to reply
14 replies to this topic

#1 kevinhoque

kevinhoque

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 22 June 2020 - 02:56 PM

Hi folks,

I have a perforce question for you, which I have not been able to find the answer to on google yet, so I thought I would ask you :)

If I rename a file in p4v, p4v shows a file delete and a new file added.  If I modify the text of the new file and then shelve the files, all appears to work correctly.  P4v proceeds without incident with the shelve operation.

However, if I integrate a CL that has a file rename/move and then I modify the new file and then after that try to shelve the files, p4v reports that it cannot proceed because the file has been tampered with.  There does not appear to be a way, within p4v, to mark the new file as being in the edit state?...perhaps I need to try to use the command line?  Any ideas?

[Btw, in between the original integration of the CL that contains the file move/rename, I think I integrated another changelist after that, which also updated the new file, and then I made my manual edits.  Although I am not sure that this extra information is relevant.  Adding just in case it is.]

Thanks :)

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1190 posts

Posted 22 June 2020 - 03:11 PM

From the command line this is "p4 edit".  Double-check to see if P4V offers an option like "check out" or "mark for edit" or anything like that -- if not, the command line might be the easiest option.

#3 kevinhoque

kevinhoque

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 22 June 2020 - 03:27 PM

Hi Sambwise, the user interface in p4v does not show any "check out" or "mark for edit" commands - hence my query.  I tried your command line idea.  This is what I see:

C:\Users\Kevin.hoque>p4 edit //branches/warhammer3/warscape_staging/common/BOB/WarscapeShared/action_tree.cpp
//branches/warhammer3/warscape_staging/common/BOB/WarscapeShared/action_tree.cpp - can't edit (already opened for move/add)

Perhaps there is an argument that I need to pass?

Thanks :)

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1190 posts

Posted 22 June 2020 - 03:39 PM

Ah!  "p4 edit" should actually work here; that's a bug.  Here's a workaround that does what "p4 edit" should do in this situation:

echo ae|p4 resolve -f //branches/warhammer3/warscape_staging/common/BOB/WarscapeShared/action_tree.cpp


That'll downgrade the resolve action on the file to "edit", which will make it eligible for reverse integration (and ineligible for "tamper checking", so you can edit it freely).

#5 kevinhoque

kevinhoque

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 22 June 2020 - 04:01 PM

Hi Sambwise, thanks for your suggestion and help so far.  This is what I see in the cmd window:

C:\Users\Kevin.hoque>echo ae|p4 resolve -f //branches/warhammer3/warscape_staging/common/BOB/WarscapeShared/action_tree.cpp
T:\branches\warhammer3\warscape_staging\common\BOB\WarscapeShared\action_tree.cpp - merging //branches/3k/dev/common/BOB/WarscapeShared/action_tree.cpp#2
Diff chunks: 24 yours + 0 theirs + 10 both + 1 conflicting
Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) e: There are still change markers: confirm accept (y/n)? EOF reading terminal.
There are still change markers: confirm accept (y/n)?
Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) e: EOF reading terminal.
//Kevin.Hoque_KEVIN_HOQUE_439/branches/warhammer3/warscape_staging/common/BOB/WarscapeShared/action_tree.cpp - resolve skipped.
T:\branches\warhammer3\warscape_staging\common\BOB\WarscapeShared\action_tree.cpp - merging //common/BOB/WarscapeShared/action_tree.cpp#10
Diff chunks: 30 yours + 0 theirs + 6 both + 2 conflicting
Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) e: EOF reading terminal.
//Kevin.Hoque_KEVIN_HOQUE_439/branches/warhammer3/warscape_staging/common/BOB/WarscapeShared/action_tree.cpp - resolve skipped.

I then tried to shelve the file and still see the issue regarding tampered file:

p4v_error.jpg

Any other ideas...? :)

Thanks so much again for your help! :)

#6 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1190 posts

Posted 22 June 2020 - 04:11 PM

The fact that there were multiple merges on this file makes it a little more complicated.  (I'm surprised it didn't already end up as an "edit" as a natural byproduct of the merge process given that there are conflicts!)  Could you run "p4 resolved <file>" and post the output of that?

#7 kevinhoque

kevinhoque

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 22 June 2020 - 04:19 PM

Yes, for this task, I need to integrate 5 changelists - only once I have all 5 will the feature be in a working state and I would submit then.  Ordinarily this isn't a problem.  But this file rename/move, from the first integration CL, has changed all that :)

This is the output from the "resolved":


C:\Users\Kevin.hoque>p4 resolved //branches/warhammer3/warscape_staging/common/BOB/WarscapeShared/action_tree.cpp
T:\branches\warhammer3\warscape_staging\common\BOB\WarscapeShared\action_tree.cpp - resolved move (copy from //branches/warhammer3/warscape_staging/common/BOB/WarscapeShared/action_tree.cpp)

Hope this helps :)

Just noticed that the copy from is not what I expected it to be. I thought it would be:

//branches/warhammer3/warscape_staging/common/BOB/Plugins/Cs2/action_tree.cpp

#8 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1190 posts

Posted 22 June 2020 - 04:31 PM

Oh -- run "p4 resolved" on the local path (not the depot path) to see all the resolves that went into that file.  Specifically, the local path of the file that's currently open for "move/'add". Running it on the depot path shows you resolves where that depot path was the source.  E.g.:

C:\Perforce\test\move>p4 resolved //stream/main/move/B2
c:\Perforce\test\move\B2 - resolved move (copy from //stream/main/move/B2)


C:\Perforce\test\move>p4 resolved B2
c:\Perforce\test\move\B2 - edit from //stream/main/move/A2#1
c:\Perforce\test\move\B2 - moved from //stream/main/move/B1#1
c:\Perforce\test\move\B2 - resolved move (copy from //stream/main/move/B2)

The resolve you see when you use the target depot path is the filename resolve, where the "source" was the source filename mapped through the branch view into the target namespace.  The source of the actual content is still in the source branch's namespace (in my toy example it's "A2").

#9 kevinhoque

kevinhoque

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 22 June 2020 - 04:48 PM

Hi Sambwise.  Is this what you wanted me to do?  

C:\Users\Kevin.hoque>p4 resolved T:\\branches\\warhammer3\\warscape_staging\\common\\BOB\\WarscapeShared\\action_tree.cpp
T:\\branches\\warhammer3\\warscape_staging\\common\\BOB\\WarscapeShared\\action_tree.cpp - no file(s) resolved.

It didn't seem to do much, but no obvious error messages...Sorry if I got it wrong again!

Adding a screen grab of the changelist, as it might be helpful..

p4v_changelist.jpg

Thanks! :)

#10 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1190 posts

Posted 22 June 2020 - 04:56 PM

Try:

T:
cd \branches\warhammer3\warscape_staging\common\BOB\WarscapeShared
p4 resolved action_tree.cpp

(don't double up the backslashes!)

#11 kevinhoque

kevinhoque

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 22 June 2020 - 05:08 PM

Oh dear! I deserved that one :)

Here you go:

C:\Users\Kevin.hoque>p4 resolved T:\branches\warhammer3\warscape_staging\common\BOB\WarscapeShared\action_tree.cpp
T:\branches\warhammer3\warscape_staging\common\BOB\WarscapeShared\action_tree.cpp - merge from //branches/3k/dev/common/BOB/WarscapeShared/action_tree.cpp#2
T:\branches\warhammer3\warscape_staging\common\BOB\WarscapeShared\action_tree.cpp - moved from //branches/warhammer3/warscape_staging/common/BOB/Plugins/Cs2/action_tree.cpp#1,#3
T:\branches\warhammer3\warscape_staging\common\BOB\WarscapeShared\action_tree.cpp - resolved move (copy from //branches/warhammer3/warscape_staging/common/BOB/WarscapeShared/action_tree.cpp)
T:\branches\warhammer3\warscape_staging\common\BOB\WarscapeShared\action_tree.cpp - merge from //common/BOB/WarscapeShared/action_tree.cpp#10

Thanks Sambwise! :)

#12 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1190 posts

Posted 22 June 2020 - 05:35 PM

Okay, so I think here's what you want to do.  This is a little awkward because there were multiple merges that must have required conflict resolution (as far as I can tell) but they were recorded (incorrectly?) as having been pure merges.  I'm guessing this was done via P4V (I dimly remember it having a bug along these lines at some point, although I'd thought it'd been fixed by now)?

To get everything into the desired state, I think you want to just back up the merge result, redo the resolve to force the correct record types (ignoring the fact that the re-resolve is going to be undoing your previous work), and then restore the actual content from the backup.

cd T:\branches\warhammer3\warscape_staging\common\BOB\WarscapeShared
copy action_tree.cpp action_tree.cpp.resolved
p4 resolve -f action_tree.cpp
ae
y
ae
y
del action_tree.cpp
rename action_tree.cpp.resolved action_tree.cpp

Now you have the desired content in your workspace (with your edits plus whatever conflict resolution work was done earlier), but those two "merge from" records are now "edit from" records, indicating that the workspace file has unique edits in it.  A "merge from" record indicates that the file was the result of a "pure" (non-conflicting and unedited) merge from the given source revision(s), and comes with a guarantee (enforced via a checksum comparison at shelve/submit) that the file wasn't modified subsequent to resolve.

#13 kevinhoque

kevinhoque

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 22 June 2020 - 05:52 PM

Yes that's correct Sambwise, the merges were not automatic, as there were several conflicts that I needed to resolve.  After the integrations and manual resolves I edited the files to fix the compile and logic errors.

I am wondering, once I have done this, will perforce be aware of the integrations for operations like "Revision Graph"?  At this stage, I will just be happy for the files to be in a state that I can work with them again.  Just curious about the integration history information.

Thanks! :)

#14 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1190 posts

Posted 22 June 2020 - 05:59 PM

View Postkevinhoque, on 22 June 2020 - 05:52 PM, said:

Yes that's correct Sambwise, the merges were not automatic, as there were several conflicts that I needed to resolve.  After the integrations and manual resolves I edited the files to fix the compile and logic errors.

If there were conflicts and P4V recorded them as "merge from", that's a bug in P4V; if you have a support plan I recommend reporting it through that channel!  Recording a conflicted merge as a pure "merge" can make your later merges more difficult or even cause changes to be lost when you merge to other branches.

Quote

I am wondering, once I have done this, will perforce be aware of the integrations for operations like "Revision Graph"?  At this stage, I will just be happy for the files to be in a state that I can work with them again.  Just curious about the integration history information.

Yes; the only difference is that they'll be recorded as "edits", which is represented in Revision Graph as a red dashed arrow (instead of a black dashed arrow) and a little dog-ear on the target revision.

#15 kevinhoque

kevinhoque

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 22 June 2020 - 06:18 PM

Sambwise, that worked! I am now able to shelve the file.  Thanks you so much! :) I really appreciate all the time you have spent with me to get this working! :)

Have a great rest of your day! :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users