Jump to content

Sambwise's Content

There have been 242 items by Sambwise (Search limited from 29-October 19)

By content type

See this member's

Sort by                Order  

#26639 How to identify the version of a file which has a specific "String" i...

Posted by Sambwise on 23 July 2020 - 10:20 PM in General

Handling multi-line strings is a lot easier with the scripting APIs:

from P4 import P4
import sys

p4 = P4()
[filelog] = p4.run_filelog("-l", sys.argv[1])

print([f"#{r.rev}" for r in filelog.revisions if sys.argv[2] in r.desc])

% p4 filelog -l text.txt
... #4 change 181 edit on 2020/07/23 by Samwise@Samwise-dvcs-1509687817 (text)

		multi line description
		keyword here
		blah blah blah

... #3 change 180 edit on 2020/07/23 by Samwise@Samwise-dvcs-1509687817 (text)

		blah blah blah blah

... #2 change 179 edit on 2020/07/23 by Samwise@Samwise-dvcs-1509687817 (text)

		blah blah blah test blah

... #1 change 178 add on 2020/07/23 by Samwise@Samwise-dvcs-1509687817 (text)

		blah blah blah blah

% python desc_grep.py text.txt keyword

% python desc_grep.py text.txt test

% python desc_grep.py text.txt blah
['#4', '#3', '#2', '#1']

#26631 A way to timestamp or revisionstamp a submission?

Posted by Sambwise on 21 July 2020 - 02:45 PM in P4V

If it's zipped, there's no way that text-based logic is going to work on it.  I assume there's no option in the settings to save it uncompressed?

The easiest solution at that point is probably to manually update a counter in the file.  That's potentially a thing you could automate to some extent by writing some kind of trigger in Perforce (e.g. a content trigger that validates that the counter is different from the last revision and reminds you to update it if it hasn't).

A useful enhancement request for Perforce that would make this work without having to special-case Word files specifically might be to apply keyword expansion to ubinary+k files after attempting to unzip the file (on the assumption that ubinary files are usually typed that way because they were zipped on the client), rezipping them after expansion if successful.  You'd need to have an active support contract to be able to make a request like that though.

#26627 A way to timestamp or revisionstamp a submission?

Posted by Sambwise on 20 July 2020 - 06:45 PM in P4V

It shouldn't need the colon.  Try opening the file in a text editor; does the $Revision$ string appear intact, or does it have extra binary junk mixed into it?

If it does, you could try different format/encoding options when saving the file to see if any of the available options will save the file in something close enough to ASCII that it doesn't mangle unformatted strings.

#26625 Login from command line fails

Posted by Sambwise on 20 July 2020 - 03:32 PM in General

Is there a trailing space in your P4PORT value?

Perforce client error:
Connect to server failed; check $P4PORT.
  TCP connect to gb-wct-flexfs01:1666  failed.
  The specified class was not found.

(Maybe set via a P4CONFIG file?  You'd have to work at it to get a trailing space with p4 set but it's pretty easy to leave a trailing space in a text file and not notice it.)

#26620 Can I break the creating checkpoint process

Posted by Sambwise on 18 July 2020 - 02:57 PM in Administration

View Postytt1515234, on 18 July 2020 - 08:06 AM, said:

thank you! so it's safety to break the process, that's a good news!
from your answer, can I say that size of db files will affect the time spent on creating checkpoint? The db files save records from journal, and the checkpoint read records from db files, is this the workflow?

Yes, the size of the db files is a much better gauge for how long the checkpoint will take!

If you want to try to gauge how close the checkpoint is to completion, you can peek at the checkpoint file and see which tables have been dumped so far.  The tables will be checkpointed in the locking order (documented here: https://www.perforce...current/schema/) and the number of rows in each table will roughly correspond to their size on disk.  Typically db.have, db.rev, and db.integed are the largest ones.

#26618 Can I break the creating checkpoint process

Posted by Sambwise on 18 July 2020 - 07:12 AM in Administration

The time to create a checkpoint isn't necessarily a function of the size of the journal file; most of what's in the journal won't end up in the checkpoint (e.g. db.have entries that have since been overwritten).

Since a checkpoint is primarily a read operation, it should be safe to kill it without damaging the db, but the checkpoint it's writing will be incomplete and is not suitable for recovery, and the journal will not be rotated.  The next time you take a checkpoint it'll start over from the beginning.

#26613 P4 Jenkins

Posted by Sambwise on 15 July 2020 - 06:26 PM in General

I'm not very familiar with the Jenkins plugin, but it looks like it's trying to append a depot path to a client path.  Is there maybe someplace in the configuration where you're supposed to enter the path to the "Jenkinsfile" as a relative path and you've entered an absolute depot path instead?

#26608 Basic setup considerations

Posted by Sambwise on 14 July 2020 - 10:08 PM in General


If he left without checking out properly, I´ll have to do some cleanup and he might loose some work, but thats probably about it, potential risk wise.

You can check at the time you delete the workspace whether the user has any files open, and then either prioritize keeping that workspace around or remind the user when they come back that they'll need to reconcile to make sure their changes are accounted for.

You might also want to look at the p4 unload command: https://www.perforce.../p4_unload.html

I'm not sure offhand whether an unloaded client counts toward the license limit, but if it doesn't that would be a very easy fix for offboarding/reonboarding users.

#26606 Basic setup considerations

Posted by Sambwise on 14 July 2020 - 03:13 PM in General

The scheme with sharing user names and then having weird named workspaces sounds overly complex.


After two months, he wants to come back to the project. As I still have a free spot, I create user "HarryP" again, and he...creates a new workspace and resyncs all the files he needs?

Or could he reconnect his old worspace?

Nothing stopping him from using the old workspace as long as you haven't had to delete it in the meantime.  I'd just go with that option (cycle usernames, keep workspaces) as long as you have the headroom for it.  If you run out of workspaces, you can always delete the ones that are the least likely to need to be recreated.

#26598 Why are these files left open for delete even after resolve

Posted by Sambwise on 14 July 2020 - 02:01 AM in General

"revert -a" only reverts unchanged files.  You want just regular "p4 revert //..." if you want to revert everything.

#26596 Basic setup considerations

Posted by Sambwise on 13 July 2020 - 09:43 PM in General

You should be able to do something like:

	binary +S3 //....uasset
	binary +S10 //.../M_*.uasset
	binary +S10 //.../Mi_*.uasset

With any kind of mapping (client view, protections, typemap, etc) the later lines take precedence, so you can define exceptions by having narrower rules follow broader ones.

#26591 Basic setup considerations

Posted by Sambwise on 13 July 2020 - 03:20 PM in General

1) Stop the server.
2) Delete the contents of P4ROOT (this will blow away your entire server, but nothing valuable is in there yet, right?)
3) Make this change to the startup script:

p4start="p4d -d"


p4start="p4d -d -C1"

4) Start the server again; it will start up with the -C1 flag you added, and create a new case-insensitive database.

#26586 Basic setup considerations

Posted by Sambwise on 13 July 2020 - 12:45 AM in General

View Postinsertmesh, on 12 July 2020 - 10:47 PM, said:

1. Since it seemed the easiest thing to do, I tried to use the p4 protect table to exclude certain files and folders to be added.
This failed:

list user * * -//.../000_Director/...

Once I added these, I successfully created a folder named "000_Director" AND successfully added it to the depot.

The protections *look* right to me.  Are you positive that the folder's name was exactly the same (case sensitive) as what you put in the protection table?  If you run "p4 files //.../000_Director/..." do you see the files in that folder?


A) Is it enough if I just create ONE stream called "mainline (or whatever I pick)"? Or do I need to create another branch/stream from that "mainline" stream, so I can assign some ignore lists to it for all the collaborators?
Just wondering because of the -P parent reminder in the commandline prompt

You just need one.  The mainline stream doesn't have a parent; if you had more streams, the mainline would be their parent, but you don't need to have more streams.


B) Why would I need more than one stream? So I can assign different views/ignores to each? So for example: Animators get assigned the "animators" stream, which only includes mapping to the "animations" folder in the main depot, Modellers get assigned the "modellers" stream, which only includes mapping to the "models" folder of the project?

That would be one reason; you'd do this by creating virtual streams.  A "virtual" stream acts like you're working in the parent (you don't branch/copy the files, you just work on them directly), but its Paths can be a smaller subset of the parent.

Another reason for making a new stream is usually so that you can branch a copy that has its own history, e.g. a "release" stream (which represents a copy of the code you've released to customers) or a "development" stream (which represents a copy that you're doing work-in-progress on that isn't ready for the mainline).  This is something that's very useful in large software projects but may not be applicable to your project.


C) How would I then specify which user gets assigned which stream, if I need to/want to create more than one? Or would I just have to tell them to pick one stream, when they create their workspace?

They pick a stream when they create their workspace.


What I can´t get to work:
How do I get to the exclude table you posted above?

So, what exactly do I have to type after this:

p4 stream

Lets have this example:

I have created a default depot.
I have created a mainline stream.
I want to exclude all folders named "Saved"
I want to exclude all files including the name "_buildData"

C:\Perforce\test>p4 depot -t stream collaborators
Depot collaborators saved.

C:\Perforce\test>p4 stream -t mainline //collaborators/main

Then in the form that comes up I leave the "share ..." Paths and I add two Ignored entries:

	share ...


All done!

Stream //collaborators/main saved.

C:\Perforce\test>p4 client -s -S //collaborators/main
Client Samwise-dvcs-1509687817 switched.

C:\Perforce\test>p4 where ...

//collaborators/main/... //Samwise-dvcs-1509687817/... c:\Perforce\test\...
-//collaborators/main/.../Saved/... //Samwise-dvcs-1509687817/.../Saved/... c:\Perforce\test\...\Saved\...
-//collaborators/main/Saved/... //Samwise-dvcs-1509687817/Saved/... c:\Perforce\test\Saved\...
-//collaborators/main/..._buildData... //Samwise-dvcs-1509687817/..._buildData... c:\Perforce\test\..._buildData...

The "p4 where ..." command shows me the client view that is generated from the stream -- it's automatically added exclusions for the Saved folder (both at the root of the stream and for anywhere below it; you need two exclusions to capture the edge case, but the streams logic takes care of this for you) and for the _buildData substring.

#26585 Getting Started in P4V

Posted by Sambwise on 13 July 2020 - 12:29 AM in P4V

View Postdtveraas, on 12 July 2020 - 11:32 PM, said:

Or with "p4 add [file destination]" I get "- missing, assuming text."

You need to have an actual file to add.  It sounds like you specified the name of a file that doesn't exist.

Could you copy and paste the exact stuff you're doing from the terminal, including the prompt that shows what directory you're in?  Like this:

C:\Perforce\workshop\guest\sam_stafford>p4 add foo
//guest/sam_stafford/foo#1 - opened for add
c:\Perforce\workshop\guest\sam_stafford\foo - missing, assuming text.

If you can show me output like that, and tell me where your project files are, I can tell you exactly where you're going wrong and how to fix it.


Should I need to add files this way? I feel like there should be a way I can just connect to this server via UE4 source control. Is that thought just bonkers?

Ideally, UE4's Perforce plugin would just do all this automatically and you'd never have to touch either P4V or the command line.  It knows exactly where your files are, and it knows which ones should be added to Perforce and which ones shouldn't, so it could do the whole thing automatically if it wanted to -- create the workspace, set up the exclusions, add the files, everything.  It should be able to just prompt you for your login information, ask you what depot directory this project is supposed to live in, and then do everything else for you.  But from what I've heard, it's not set up that way.  :(

#26580 How to access command line on my VPS?

Posted by Sambwise on 12 July 2020 - 07:00 PM in Administration

Just delete all the stuff from the local server, including its old P4CONFIG file (the one whose path is displayed when you run "p4 set" in that directory).  Uninstalling won't actually fix anything because the uninstaller doesn't delete any local data.  Once you delete the P4CONFIG file then it won't override your P4PORT setting any more and it won't matter what directory you're in.

Test that the VPS is running with the "p4 info" command.  That asks the server to send you information about itself and about how you're connected to it -- if the server isn't running, you'll get a connection error.

C:\Perforce\workshop>p4 info
User name: sam_stafford
Client name: samwise-compy386
Client host: COMPY386
Client root: c:\Perforce\workshop
Current directory: c:\Perforce\workshop
Peer address:
Client address:
Server date: 2020/07/12 12:00:56 -0700 PDT
Server version: P4D/LINUX26X86_64/2020.1/1953492 (2020/04/24)
ServerID: guru_master
Server services: standard
Server license: Licensed
Case Handling: sensitive

#26577 How to access command line on my VPS?

Posted by Sambwise on 12 July 2020 - 06:44 PM in Administration

Ah -- maybe the earlier time you were in the directory for a local server, and so its P4CONFIG was being applied.  If you run p4 set by itself it'll show you what your current settings are:

C:\Perforce\test>p4 set
P4CHARSET=none (config 'c:\Perforce\test\p4config.txt')
P4CLIENT=Samwise-dvcs-1509687817 (config 'c:\Perforce\test\p4config.txt')
P4CONFIG=p4config.txt (set) (config 'c:\Perforce\test\p4config.txt' )
P4EDITOR=notepad (set)
P4IGNORE=p4ignore.txt (config 'c:\Perforce\test\p4config.txt')
P4INITROOT=c:\Perforce\test (config 'c:\Perforce\test\p4config.txt')
P4MERGE=vsmerge.bat (set)
P4PORT=rsh:p4d.exe -i -J off -r "c:\Perforce\test\.p4root" (config 'c:\Perforce\test\p4config.txt')
P4USER=Samwise (config 'c:\Perforce\test\p4config.txt')

Most of the settings here are coming from a P4CONFIG file that's in the working directory.  If I go to a directory where there's no P4CONFIG file then I just get the values that I've set with "p4 set":

C:\>p4 set
P4CONFIG=p4config.txt (set) (config 'noconfig')
P4EDITOR=notepad (set)
P4MERGE=vsmerge.bat (set)
P4PORT=1777 (set)
P4USER=bob (set)
P4_1777_CHARSET=none (set)

#26574 How to access command line on my VPS?

Posted by Sambwise on 12 July 2020 - 06:04 PM in Administration

That's a P4PORT string for a local server.  You need to use the same P4PORT that you're using to connect to your VPS from P4V -- it should have the hostname or IP of your VPS, followed by :1666.

If you aren't using a string like that to connect from P4V, P4V isn't actually connected to your VPS...

#26573 Basic setup considerations

Posted by Sambwise on 12 July 2020 - 05:59 PM in General


Shouldn´t they be locked, when being checked out?
Lets say:

User A checks out File X
User A makes some changes, forgets to check in.
If User B now opens up Unreal, it should say the file is checked out by User A, so he shouldn´t be able to check it out and make changes.
But in theory, he could still just overwrite the file, for example from explorer, when its not locked?

Disclaimer: I have no idea how Unreal works.  I'll just show how this works from the command line.

bob@ws1 opens //depot/foo for edit and adds the line "bob's change" to it:

C:\Perforce\test5\ws1>p4 edit foo
//depot/foo#1 - opened for edit

C:\Perforce\test5\ws1>echo "bob's change" >> foo

fred@ws2 opens //depot/foo for edit and adds the line "fred's change" to it:

C:\Perforce\test5\ws2>p4 edit foo
//depot/foo#1 - opened for edit
... //depot/foo - also opened by bob@ws1

C:\Perforce\test5\ws2>echo "fred's change" >> foo

Fred gets told that Bob has the file open, but he's not prevented from doing anything.  Both Bob and Fred can work at the same time.

If Fred submits his change from ws2:

C:\Perforce\test5\ws2>p4 submit -d "submitting Fred's change"
Submitting change 2.
Locking 1 files ...
edit //depot/foo#2
Change 2 submitted.

now Bob over in ws1 won't be able to submit until he resolves Fred's change:

C:\Perforce\test5\ws1>p4 submit -d "submitting Bob's change"
Submitting change 3.
//depot/foo - must resolve before submitting
//depot/foo - must resolve #2
Out of date files must be resolved or reverted.
Submit failed -- fix problems above then use 'p4 submit -c 3'.

That looks something like this:

C:\Perforce\test5\ws1>p4 resolve
c:\Perforce\test5\ws1\foo - merging //depot/foo#2
Diff chunks: 0 yours + 0 theirs + 0 both + 1 conflicting
Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) e: d
> >>>> ORIGINAL //depot/foo#1
> ==== THEIRS //depot/foo#2
> "fred's change"
> ==== YOURS //ws1/foo
Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) e: e
Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) am: am
//ws1/foo - merge from //depot/foo

C:\Perforce\test5\ws1>p4 submit -c 3
Submitting change 3.
Locking 1 files ...
edit //depot/foo#3
Change 3 submitted.

Now let's see a different scenario, where Bob locks the file.  He's annoyed that Fred made him resolve a conflict last time.

C:\Perforce\test5\ws1>p4 sync ...
//depot/foo#3 - updating c:\Perforce\test5\ws1\foo

C:\Perforce\test5\ws1>p4 edit foo
//depot/foo#3 - opened for edit

C:\Perforce\test5\ws1>p4 lock foo
//depot/foo - locking

C:\Perforce\test5\ws1>echo "bob's second change." >> foo

Now Fred tries to make a change at the same time as Bob and he's thwarted:

C:\Perforce\test5\ws2>p4 edit foo
//depot/foo#3 - opened for edit
... //depot/foo - locked by bob@ws1

C:\Perforce\test5\ws2>echo "fred's second change" >> foo

C:\Perforce\test5\ws2>p4 submit -d "submitting fred's change"
Submitting change 4.
//depot/foo - already locked by bob@ws1
No files to submit.
File(s) couldn't be locked.
Submit failed -- fix problems above then use 'p4 submit -c 4'.

Fred is able to open the file, but he's not able to lock or submit it, because Bob is holding a lock.  If Bob submits his change, Fred will need to be the one to resolve.

What if it's not possible to resolve this file at all (say, it's a binary file that you can't merge), and so you want to make sure that Fred can't even open the file?  For that, there's the +l filetype:

C:\Perforce\test5\ws1>p4 typemap -o | tail -n3
		+l //....bin

C:\Perforce\test5\ws1>p4 add foo.bin
//depot/foo.bin#1 - opened for add

C:\Perforce\test5\ws1>p4 opened
//depot/foo.bin#1 - add default change (text+l)

C:\Perforce\test5\ws1>p4 submit -d "adding a binary file"
Submitting change 5.
Locking 1 files ...
add //depot/foo.bin#1
Change 5 submitted.

C:\Perforce\test5\ws1>p4 edit foo.bin
//depot/foo.bin#1 - opened for edit

C:\Perforce\test5\ws1>echo "bob's very binary change" >> foo.bin

So here I have a typemap that puts the +l filetype on any file that ends in .bin.  Bob adds a file, and then opens it for edit.  What does Fred see if he tries to sync and edit that file?

C:\Perforce\test5\ws2>p4 sync
//depot/foo.bin#1 - added as c:\Perforce\test5\ws2\foo.bin

C:\Perforce\test5\ws2>p4 edit foo.bin
//depot/foo.bin - can't edit exclusive file already opened
... //depot/foo.bin - also opened by bob@ws1

No dice -- Fred can't even open this file because of the +l type.  He can still modify it locally if he really wants to, but Perforce is going to do its very best to dissuade him from that by leaving it read-only and giving him an error message when he tries to open it for edit.

If Bob goes on vacation in this scenario, instead of p4 unlock -f you need to use p4 revert -C to revert the file on his client.



Ignores a folder named "folder" and all its content


Ignores all filetypes ending in .exe

But what about ignoring all files including a keyword, like  "buildData"?

These are all just simple string patterns that are applied to file paths.  "..." matches any substring.

//...exe -> any file path that ends in exe  
//....exe -> any file path that ends in .exe  
//Save/... -> any file path that starts with //Save/ (i.e. anything under the Save depot)
//depot/Save/... -> any file path that starts with //depot/Save/ (i.e. anything in a folder called Save in the depot depot)
//...Save/... -> any file path that contains Save/ (i.e. anything under any folder whose name ends in Save)
//.../Save/... -> any file path that contains /Save/ (i.e. anything under any folder whose entire name is Save)
//...buildData... -> any file path that contains buildData anywhere in it (i.e. any file with buildData anywhere in its path, including in any parent folder)
//...buildData.../... -> any file path that contains buildData before the final / (i.e. any file in a folder with buildData in its name, but not necessarily in the base file path)

etc.  These are just different applications of two simple ideas:
  • paths are strings.
  • "..." is a wildcard that matches any part of a string.

#26570 How to access command line on my VPS?

Posted by Sambwise on 12 July 2020 - 05:18 PM in Administration


p4 set p4port=your.vps.host:1666

but replace your.vps.host:1666 with the right value.  (Same server port you use to connect with P4V.)

You may also need to do:

p4 set p4user=your.user.name
p4 set p4client=your.workspace.name

p4 set is persistent so you'll only need to do this once.

#26568 Basic setup considerations

Posted by Sambwise on 12 July 2020 - 03:10 PM in General


-certain folders and asset types being ignored from syncing

Three options here:

1) Use streams.  This is IMO the easiest and most flexible option.  You just make a stream like:

Stream: //stream/main
Type: mainline
	share ...

Now when everyone else makes a client, instead of specifying a View, they just say:

Stream: //stream/main

And they automatically get the view that's defined by the Paths and Ignored in //stream/main.If you change //stream/main, their clients all magically update!  It's pretty cool.  The fact that streams *also* make branching/merging easy is nice if you use those features, but they're still very useful if you use them for nothing but managing client views.

2) Use permissions.  Just specify a protection table that blocks off access to the things you don't want people to add:


This has the benefit of being centrally managed and impossible to override, like streams.  The main downside is that it's a little more likely to confuse users since they can't see the protection table, and only "super" users (i.e. you) will be able to add new asset types to this list.

3) Use triggers to enforce specific client views.  This is basically the "implement streams yourself" option; you probably don't want to do this.  It involves a lot of coding.


-all binaries only keep 3 revisions.

Using typemaps is the easiest method for this, but you have to explicitly list out the binary types by path (i.e. by file extension).  There isn't a way to do a mapping that's based on the actual detected type, unfortunately.


I´m not sure if thats even possible...but can a user check out a file and keep it checked out, even after closing the file in Unreal?
In this scenario, if the user would disappear (as the often do in a project like this), can I manually unlock the file and if so how?
If thats not possible, aka, if the file automatically gets checked out, if he closes unreal, this doesn´t apply and I don´t need to worry about it.

By default files aren't locked when they're checked out, so you don't often have this problem.  (Does Unreal maybe automatically lock the file when the user opens it?)  If the user does have the file locked when they wander off, "p4 unlock -f" is indeed the way for an admin to override it.


Do I need to delete the workspace created by this user on the server? Or is that only being stored locally on the user side anyways?

Yup, client specs are indeed stored on the server and do affect unlicensed usage, so you'll need to clean them up when you're done with them.


3. Line:
Disallows access to all folders named "saved" on the depot to all users belonging to group "collaborator".

For this you want the path to be //.../Saved/...

#26567 How to access command line on my VPS?

Posted by Sambwise on 12 July 2020 - 02:56 PM in Administration

To use client commands from the command line, you don't need to actually be logged in to the VPS.  Just install the p4 command line on your local machine (the same one you're using P4V on).  Perforce is client/server software; the whole point is that you can use it from anywhere as long as you have a network connection.  :)

#26560 To hyperthread or not?

Posted by Sambwise on 09 July 2020 - 11:44 PM in General

It's pretty rare for the Perforce server to be CPU-bound in the first place (at least in my experience -- there are probably unusual situations out there where CPU would be a limiting factor, e.g. massive map joins with the safeties off).  I suspect the "leave it off" recommendation is mostly a "if it ain't broke don't fix it" abundance of caution.

#26539 Why do files end up with open records of pending integrations even after reso...

Posted by Sambwise on 29 June 2020 - 03:10 PM in General


sc unshelve -s <shelf> //This should open up the files for edit and and overwrite the integration with changes from the shelf.
sc revert -a //... //Revert any unchanged files in projectR

Again check that there is nothing to resolve and submits it...(Clxxx)

This sounds wrong.  If the shelf contains files that are already open (in this case they'd be open for integrate), a resolve should be required to merge the shelf's changes with the pending changes in the workspace.

If you wanted to make sure that the thing you just submitted includes the shelved changes, you could "p4 diff" vs the shelved revision before submitting (or for that matter "p4 diff -f" or "p4 diff2" after submitting).


To cross-check that everything is clean, the user in a new client refreshes the WA (which includes the changes he submitted earlier) and re-unshelves the same shelf..

What's a WA?  ("Work Area", i.e. workspace?)  Does "refresh" include syncing the head revision?

This workflow makes no sense, because the changes have already been submitted.  Why unshelve an old version of the changes to "cross-check" them?  After submitting the changes from a shelf, you'd usually just delete the shelf.  Syncing the submitted revision should be all you need to do to get those changes.

Run "p4 resolve -n" to see what it is that needs resolve.  I could make some guesses, but there's a lot that I don't know about what the user is doing.  It sounds like they may have opened the files before doing the unshelve, in which case they'd need to resolve the shelf vs their workspace in order to get those changes.  This does not explain why the changes wouldn't have been pulled down by a sync (unless the files were also open prior to the sync, in which case the sync itself would also schedule resolves for those files, so nothing would modify the workspace copies but you'd end up with two pending resolves per file that each contain the same changes), but I also don't actually know whether they even did a sync in the first place.  Too many variables to cover!  :)


Is the method to override the some of the integration with changes from the shelf the issue...?

Combining the copy with the unshelved changes (which could include anything) is definitely a potential source of complexity -- it in theory should all work, but if something goes wrong it's a lot harder to decipher the history when you have multiple operations mushed into one revision.  If at all possible I'd do the copy first, submit it, and THEN do the unshelve rather than squashing the two operations into one changelist.

#26538 Tracing revision history of shelve

Posted by Sambwise on 29 June 2020 - 03:03 PM in General

No, shelves are not themselves versioned.  At that point what you want is a branch; each revision to a branch is stored forever and can be referenced even after the branch has been merged back to the parent.

#26537 Why does p4 describe on a shelf show "no files" while unshelving the...

Posted by Sambwise on 29 June 2020 - 03:02 PM in General

You can combine multiple flags.  Using both "-s" and "-S" together should get you what you're looking for.