Jump to content


Tracing the source CL@ used during the integration process


  • Please log in to reply
5 replies to this topic

#1 engr.vns

engr.vns

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 29 May 2020 - 11:18 PM

Suppose that a user has a client work-area which is in the process of integration from PROJECT1 to PROJECT2 as -

> sc integ -b PROJECT1_to_PROJECT2.br @<PROJECT1_CL#>
> sc resolve -ay

The integrated files have "not been submitted" yet.

How can one figure out what was the PROJECT1_CL#  used with the sc integ command.

(The history buffer does not have the command entry any more)

Thanks in advance

#2 engr.vns

engr.vns

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 29 May 2020 - 11:25 PM

Also tried the following commands -
sc filelog <integrated_file> //Does not capture this
sc integrated
sc change -o //shows what's integrated but the source CL#

sc resolved gives you the file version # of the source file but this is not reflective of INTEGRATION CL#

#3 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 29 May 2020 - 11:53 PM

Keep in mind that the integration wasn't necessarily done from a single complete changelist -- it could have been a series of cherry-picks, multiple revisions of a single file, or any combination of things.

That said, if you start from the supposition that the user did a single integration using @CHANGE, then @CHANGE (or a reasonable equivalent for the purposes of reproducing the merge operation elsewhere) is simply the maximum changelist from among all the source revision ranges:

p4 -F %fromFile%%fromRev% resolved | p4 -x - changes | sort | tail -n1


#4 engr.vns

engr.vns

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 03 June 2020 - 03:55 PM

Fantastic. Learnt a new trick "p4 -F %fromFile%%fromRev%".

For a p4client whose integration is in progress -
p4 -F %fromFile%%fromRev% resolved | p4 -x - changes | sort | tail -n1

#5 engr.vns

engr.vns

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 03 June 2020 - 04:15 PM

For a p4client whose integration is completed a similar strategy does not work...

I am trying to get a modified version of the same recipe on a p4client which has "completed integration".

The idea what was the highest CL# that was integrated from donor project.


p4 -F %fromFile%%fromRev%%how integrated | grep -e branch -e copy | p4 -x - changes -s submitted | sort | tail -n1

Have not solved it yet...


Before I go off into a long route of post processing to extract the field... Is there a better way?






- Vish


#6 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 03 June 2020 - 04:23 PM

I usually do something along the lines of:

p4 ichanges -b PROJECT1_to_PROJECT2.b > pending.txt
p4 changes PROJECT1/... > all.txt
diff pending.txt all.txt

You can do something similar-but-different by diffing p4 changes -i PROJECT2/... and p4 changes PROJECT2/... to see which changelists were integrated into PROJECT2 from elsewhere vs which were made to PROJECT2 itself.

The variant of this with p4 integrated would be something like:

p4 -F %fromFile%%fromRev% integrated -b PROJECT1_to_PROJECT2.b | p4 -x - changes | sort | tail -n1

since you want to scope it to a particular branch.  Much easier to just tell the server what you want to see than to try to post-process it with grepping!  Remember to check "p4 help" for usage info:

	integrated -- List integrations that have been submitted

	p4 integrated [-r] [-b branch] [file ...]

		The p4 integrated command lists integrations that have been submitted.
		To list unresolved integrations, use 'p4 resolve -n'.  To list
		resolved but unsubmitted integrations, use 'p4 resolved'.

		If the -b branch flag is specified, only files integrated from the
		source to target files in the branch view are listed.  Qualified
		files are listed, even if they were integrated without using the
		branch view.

		The -r flag reverses the mappings in the branch view, swapping the
		target files and source files.  The -b branch flag is required.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users