Integrated files disappear from a pending changelist at p4v - perforce

Our user performed an integration between branches.
Integrated files were placed in a pending changelist but they are invisible when I look
at this changelist in p4v.
I can see them when I look on this changelist when I connected to another workspace, I can also see then in Eclipse.
When I choose to Resolve conflicts on this changelist it works too, but
when I try to submit the changes, there is nothing there.
After I installed a new version of p4v, the problematic pending
changelist appeared with a question mark (red triangle with a question
mark).
Any Ideas?
Thanks.

Answer from Perforce support:
This may be a working and locks out of sync
issue. Can you run the following server command:
p4d -r $P4ROOT -xf 925
Where "$P4ROOT" is the location of the db.* files.

P4V.exe allows the user to specify a filter on his workspace. Perhaps the workspace had a filter applied, such that the GUI did not show the files, where the command line client and others (ie Eclipse) would not be privy to this filter and would show the files.
Another possibility is that the user was logged in under a workspace other than his default, and the files were checked out in his default workspace. It would be easy to then find these files in his default by looking at pending changelists for all users.

Related

Perforce will not delete files and folders from Depot

I have a workspace that some files and folders were deleted offline. The workspace shows them there on the depot side. No matter what I do, I cannot get it to remove those files/folders. When I select "Mark for Delete" is says "file(s) not in client view." Well I KNOW that. That's why I want to remove them from the Depot!
The option for "Reconcile Offline Work" is grayed out. No idea why.
"Remove from Workspace" returns either "file(s) not in client view." or "no files updated" depending on its mood.
I have other folders in that area that I need to keep but I want to clean up the Depot so ONLY those folders are shown.
If I try "Get Latest Revision" with a force (I figured copy them back then delete while online), it says "11 Files Removed" but changes nothing. I have Refreshed and exited and restarted.
I am using P4V (GUI version)
Your description of the situation as having simply deleted the files offline is not accurate. If the files are not in your client view, it means you have ALSO either:
modified your client view
switched client workspaces
Undo whichever of these you did, and then Reconcile will see the missing files and open them for delete.
Since they are not currently in your client view, there is no association between the deleted files in your workspace and the corresponding depot files. Any time you want Perforce to do anything involving files in your workspace, the client view needs to specify how those files relate to the depot.
(adding more to take into account the comment about the client spec being deleted, and apparently recreated with a different view, which is pretty hard to tell you how to recover from since I don't know anything about the before/after state other than that there are files... somewhere. Unfortunately it's not possible to simply undo a client spec deletion, short of a checkpoint restore, since client specs aren't versioned objects.)
If you deleted your client spec, records of what you previously had synced to your client are deleted along with them (next time just update the Root if your workspace moves), and so Reconcile won't work, even if you recreate the client with the same View.
To be able to delete the files from P4V, you'll need to sync them, but it sounds like you have the additional problem of having re-created your client spec with an incorrect View, so you can't even sync the files yet. Here's what you'll need to do:
Add the depot path to your client view.
Sync the files to your workspace.
Mark for Delete.
Submit.
From the command line syncing is optional, so you could do these steps to delete your client (again), recreate it (with the wide-open default view this time), open the files for delete, and submit:
p4 client -d YOUR_CLIENT
p4 client -o | p4 client -i
p4 delete -v //depot/files/to/delete/...
p4 submit
If you have a spec depot, you may be able to use this to restore your workspace to a point before the view was changed.
More information about working with the spec depot is here:
http://answers.perforce.com/articles/KB/2445
Perforce doesn't recognize the offline deleted files, You have to get latest revision first with 'Fore Operation' Checked.
Now you will see all your deleted files in your depot.
If you still don't see your delete files in depot, then take a backup of the entire folder. Now delete the folder, and do a getlatest with 'Fore Operation' Checked.
Now you will for sure see the deleted files also under the depot.
Now you should do 'Mark for Delete' for the file u wish to delete from depot.

P4V how to recover a deleted workspace

The title may be misleading but I need to know more terms and more about P4V to properly summarize the question. That's also why I cannot get the answer by google.
I delete a workspace by mistake. Choose view->workspaces, and then the right pane list the workspaces I have. I delete one. And that's the one I have on another machine.
Files stay on the disk of that machine. But P4V do not show this workspace anymore. I plan to open a new connection, create a new workspace and set the same location. But I'm afraid that the sync operation will override the folder. That's not what I want. Because except from the source codes I get from depot, I have built the code. If overriden, a lot of build work has to be redone.
So, how to recover my workspace in perforce?
The situation is very similar to the one described in this KB article: http://answers.perforce.com/articles/KB/2446
After you have re-created the workspace, do not sync. As you say, it will overwrite your files (at least the read-only ones), and you don't want that.
Instead, open a command prompt and run:
p4 sync -k ...
p4 clean ...
The "p4 sync -k" tells the server to do a sync but keep what you have in your workspace instead of overwriting it. The "p4 clean" tells the server to verify what's in your workspace against what you just told it you have, and refresh any files that are different.
Do you happen to have a spec depot? Just view the client (you might have to "Show deleted depot files" if you don't already have that set up. If not, try to create a new one with the same settings (I'm hoping they were easy to remember). Do not sync the new workspace. Instead, do "p4 flush", details at p4 command info . This will make the server think you've synced to latest, but won't touch what you have on the workstation.

How to check integration history of a Cl

how to check if any changelist of project A is integrated in project B? and also to get corresponding submitted Cl in project B. Please share any perforce command
It's worth pointing out the unit of integration in P4 is files, not changelists, so the p4 commands are mostly focused around telling you which files are integrated or not. You can, however, find out which changelists still have some files that need to be integrated - use the p4 interchanges command. The Perforce docs explain the syntax.
Assuming that you have a branch spec that describes the relationship of project A and project B called projAprojB, then you can get the outstanding changelists with:
p4 interchanges -b projAprojB
You can also get a similar view of outstanding changes in the P4V Merge/Integrate dialog box.
Alternatively, you can use the 'revision graph' in P4V to see the integrations performed on a given file; doing this on a file from the changelist you want to know about will give you the information to work out if it has been integrated into the other project and the changelist for that was.
If this doesn't suit your needs then your only option is to write a script, either with shell scripting using p4 or one of the APIs provided by Perforce

Perforce reconcile offline work doesn't notice the changes

So, I created a new file and copied it over the one in the workspace. Then I selected "reconcile offline work" from the context menu of the directory containing the file, after I've updated the directory and made sure the workspace has the new version of the file - but Perforce says that no files have changed.
There is one more weirdness in this: Despite having the latest version of the program, both the p4 and p4v clients, perhaps, because of the server version, I don't have reconcile command available (I don't know what version is the server, and don't know how to find it out).
So, it would help if you could tell how to do the same thing as reconcile, while not having this command (it seems to be a newish addition, but I cannot imagine a workflow that doesn't require you to use it, or something that does the same thing). The VCS is practically useless if it cannot figure out on its own what files had changed since the last version...
If your server is older, and doesn't support reconcile, there are other ways to accomplish these tasks. Start here for all the details: http://answers.perforce.com/articles/KB_Article/Working-Disconnected-From-The-Perforce-Server
If you added a file to Perforce and copied it to another workspace you will need "p4 sync -k //depot/path/to/file" to reflect the change.

Perforce not syncing files correctly

I'm using Perforce P4V, the graphical tool, to interface with my Perforce server here at work. I have a project I added to the depot and I accidentally deleted it from my workspace on my local computer, problem is when I use the Get Revision Action (the GUI equivalent of sync), the files don't get updated, i.e. I can see the files on the server that I want, but they won't sync correctly with my local PC. It's frustrating me that the files aren't getting pulled from the server. What I'm assuming should be happening is if files are altered in anyway on my local PC, I should be able to grab the revision from the server, which then pulls the data to my local PC and overwrites the changes locally on my PC, but that isn't happening. Is there something I'm missing?
Perforce keeps track of the files that it thinks that you have on your local workstation. If you delete those files locally (and don't "tell" perforce about it), then Perforce will still think that you have those files. If you want to get them back, you need to "force sync" the files. In p4v, you can use the "Get Revision..." item and in the subsequent dialog, you can check the "force operation" checkbox to tell Perforce to give you all the files again regardless of whether Perforce thinks that you need them.
Just to complete the information, if you ever do want to remove the files locally, you can do so through p4v by choosing the "Remove from Workspace" item. Doing so will remove the files locally as well as tell perforce that you no longer have those files so that next time you sync, those files will be retrieved from the server.
Like other people have mentioned, one solution is to do a "force sync" the entire depot which is basically overwriting everything from server into your local. The downside to this is that it could take a LONG time to finish if you are working on a big depot.
Another alternative is to compare your local workspace with the server, then only force sync the files that are missing from your workspace.
p4 diff -sd //Depot/path/… | p4 -x – sync -f
-sd option: Show only the names of unopened files that are missing from the client workspace, but present in the depot.
There are more options (sa/se/etc.) available if -sd is not what you need. see here.
credits for the command goes to this blog.
They won't update because according to Perforce you still have the files on your local machine.
You need to use the "Get Revison..." option and enable the "Force Operation" option.
This will tell Perforce to refresh all the files even those it thinks you have the latest version of.
"Get Revision" will update only files that are not opened (checked out) even when "Force Operation" is enabled. You should revert all files marked as checked out in that workspace, and then use "Get Revision" with "Force Operation"
I did as you suggested, but I kept getting the message that the files were still open for edit and cannot be deleted, when trying Remove from Workspace.
Also, Get Revision returned with a message that no files were updated.
What I ended up having to do was Revert the files, then do the Get Revision action, that solved the problem.
For people coming into this question, this worked for me on the mac command line ...
cd into your local perforce workspace - the base directory of the checked out files that you are working on.
p4 sync -f
-f is to force the sync.
This can also come in handy when you restore a mac from a time machine backup.
https://www.perforce.com/perforce/r12.1/manuals/cmdref/sync.html
Check out the file, change it a little bit and then revert. Perforce will replace the local file with the latest revision.

Resources