How to filter pending changelist by changelist number - p4v

Using p4V client I want to review pending changelist with shelved files. I have the changelist number but can't find a way to filter based on changelist number.
I found out about using Ctrl-G to search for pending changelist. However that does not give me an option to unshelve.

Look for the "Unshelve..." command in the context menu of the files in the "Shelved Files" list.

Related

How to checkout from diff view?

I am using Perforce 2015 client (P4V) on Windows 7.
I changed some files in my IDE. Then I use "Folder Diff" in Perforce to locate them. I was expecting to find "checkout" right click menu on the "Folder Diff" Perforce window in order to move my changes to a changeset but I don't see any "checkout" around.
How can I checkout directly from Diff view?
If you changed files on your workstation, but Perforce doesn't know about those changes yet, the command you're looking for is "reconcile".
I believe that P4V's Folder Diff may only show you the reconcile options if you use Folder Diff from the Advanced Reconcile Options variant of Reconcile Offline Work.
So to perform this style of Folder Diff within P4V, you should start by context-clicking on the root folder in your tree view and choosing "Reconcile Offline Work", then choose the Advanced Reconcile button at the bottom of that display, as described here: http://www.perforce.com/perforce/doc.current/manuals/p4v/Offline.html
Then, when Advanced Reconcile opens up the Folder Diff, you will see suggestions in red lettering about what your options are for each file (Mark For Edit, Get Revision, ec.). You can then pick one of those options by context-clicking that file in Folder Diff.
Alternatively (and perhaps more useful, once you get used to it), you can do this from the command line. If you haven't worked directly with the command line before, you can context-click "Open Command Window Here" on the root folder of your workspace treeview to get to the command window. Then, type
p4 status
to see a report about what changes you have made to your files, and
p4 reconcile
to make those files open for add, edit, or delete, as appropriate. Then close the command window and refresh P4V to see them.
I am not sure what your exact scenario and IDE is. I am using Visual Studio with the Perforce plugin, and when I make any changes in my source this plugin will check-out this file automatically (you can also choose to be prompted). So no need for folder diffs to locate any changes.
Should your IDE miss any integration plugin's then a very simple workflow could be like this:
Go to Perforce and check out all the files in your solution
Make your edits in your IDE (online or offline doesn't really matter)
In Perforce choose 'Revert Unchanged Files' on the changelist
And voila, only the changed files will be left in your changelist, you can then review the changes and submit to the depot.
NB: should in the mean time another developer have made any changes to any of your changed files, Perforce will warn you that you need to execute a Get Latest and then Resolve (i.e. merge) the changes.

Perforce diff file against a specific changelist

Is there a way to quickly diff a file(edited in my current work area) to same file submitted in an earlier change list in perforce ?
Yes, you can specify any revision of the depot file to diff against. For example, if that 'earlier change list' was change 1742, you can simply do:
p4 diff myFile.txt //depot/path/to/myFile.txt#1742
There are lots of ways to specify the desired revision of the file in the depot. Run
p4 help revisions
for all the details, or see: http://www.perforce.com/perforce/doc.current/manuals/cmdref/filespecs.html

Perforce - create patch file of differences against have revision

In Perforce, how can I create a patch file which has the changes that are in the file as currently saved, compared to the have revision? Instructions for either the GUI client or the CLI client would be great.
I can see how to get the diffs between two changelists, but not how to just get the difference between the last changelist and the current state of the files. Additionally, I can see that in the GUI client, I can right-click on a file and select "Diff Against Have Revision" from the contextual menu, which shows me what I'm looking for, but I can't figure out how to get that into a file.
I'm basically looking for the equivalent of what git diff <file> > patch.diff does in Git-land.
I think that p4 diff -du FILE > patch.diff should do what you want.
Single file
p4 diff -du file > file.patch.diff
Every file
p4 diff -du > patch.diff
The problem with p4 diff is that it doesn't take into account of new files. Also you can't get files that are only in a certain pending change list.
If there is a pending changelist, you can actually use an open source perforce patcher tool, which I have created for my project needs. You can directly download from this link of github.
In case you want to checkout the source, go to the github repo.
Documentation for the tool can be found here.

Recover deleted file in the tfs

I have a huge repository. A while ago a file with the name FooBar.xml was deleted from some unknown directory in the tfs. What would be the easiest way to find the file? There are thousands of directories in the repository, so manually inspecting each and every one looking for deleted files is not a feasible option.
From a Visual Studio Command Prompt use the command
tf undelete $/TeamProject/FooBar.xml /noget /recursive
This will undelete any files in the repository with the name FooBar.xml, and leave the undeletes as pending changes. If you can narrow it down to a particular branch or area of your repository that will speed things up.
You can then go though the list of pending undeletes, identify the file you want to keep and "undo" the other pending changes.

Perforce - How to get the list of files that have been modified locally?

I am looking for a perforce command to get the list of the files that have been modified locally and "not" checked-in to the repository.
I understand that I "should" get the list of modified files in Pending changelist, but there are scenarios when I don't get to see a modified file in that list. And then on "manually" checking out a file and doing a diff i realize the difference.
Is there any command that could check all the files in a given folder and provide me a list of files that are not same as there state in the repository?
I tried "p4 sync", but that did not work.
Thanks for your interest.
Try
p4 diff -f -sa
(see manual for further details)
I use "p4 revert -n ./..."
where
-n
List the files that would be reverted without actually performing the revert.
This lets you make sure the revert does what you think it does before actually reverting the files.
In the recent versions of Perforce, try "p4 reconcile -e"
see: http://www.perforce.com/perforce/r12.1/manuals/cmdref/reconcile.html
It certainly takes its time though (not very fast).
I think, the modified files are submitted locallay (Otherwise, p4 opened ./... will help to find)
If files are already submitted to local perforce and still want to know which all are modified..
p4 changes -m 5 ./... (Should give changes lists)
p4 integrate -n ./... //server/code/base/... (This should list the files to be integrated to mainline.