Use p4v to untag files? - perforce

I am using p4v windows client and I want to untag files.
On command line it would be
p4 tag -d -l <tagname> <filenames>
How can i do this in p4v?
In response to one of the answers...
There IS a difference between p4 label and p4 tag
Running p4 label allows you to configure the mapping that controls the set of files that are allowed to be included in the label. After configuring the label, use p4 labelsync or p4 tag to tag files with the label.
from http://www.perforce.com/perforce/doc.current/manuals/cmdref/label.html
see also http://www.perforce.com/perforce/doc.current/manuals/cmdref/tag.html

Right click on the file, and go to Label... Then select the file in the Files/Folders: section, and click remove.

Related

How to open files in different ChangeList(s) into default change list?

Let's say I have few files under CL: 123 and few files under CL:456 . How do I open all the files together in one changelist or into a default changelist so that I can submit them together ?
In the P4 client:
p4 reopen -c <changelist#> //path/to/file
...will put it in your default changelist
In P4V, select all of the files you want to move to another changelist. You can either drag-n-drop them to the preferred changelist, or right-click and choose Move to Another Changelist...

How to remove files from changelist in perforce without losing modifications?

I accidentally created a new changelist with files from WORKSPACE not from DEPOT and now under the changelist 4500 modified files are displayed (all dlls pdbs etc. alongside with the files i actually edited)
I'm using the p4v GUI. Is there anyway to undo this, without having to backup all the files then revert them using perforce, put them back and create a new changelist using DEPOT.
Thanks a lot, i hope there's a workaround :).
Not sure if this is what you're looking for, but to remove checked out files from your changelist without removing the edits:
p4 revert -k -c changelist# //...
If you haven't submitted the changelist, and all of the files are marked with '+' in the changelist in the Pending tab, you can click 'Revert' on the changelist. As long as the files were marked for add ('+') they'll be left intact in your workspace.
There's multiple ways.
Select View->Pending Changelists from the menu bar to view your pending changelist tab. You should see all of your checked out files grouped by changelist. Go to your desired changelist and expand into files.
You can Ctrl+left-click multiple files, then right-click on one of them and select Move to another changelist....
You can also choose to Submit... the files, and when the dialog box appears, their will be checkboxes next to each file. Uncheck the files you do not want to submit.
As another answerer mentioned, if you accidentally added files to Perforce that you did not intend to, you can indeed revert those files without actually deleting them (the only time a file will actually go away is when you do a p4 delete or p4 move.)
I encountered a similar issue, the solution i used is as follows:
1. Navigate to the workspace using p4v
2. Right click on one of the folders or files and click "Open Command window here"
3. run the following command to review dll or pdb respectively
p4 revert //....dll
p4 revert //....pdb
Thanks,
Lyon
If you right click on a pending changelist in p4v you should have the option to Revert unchanged files, which does exactly what it says on the tin.

How do I make the perforce command line view the same as the P4Win view

I've written some python tools which work with the p4 command line to work on files I have opened in P4Win. However it seems like the p4 view can become different to the P4Win view. I'm not quite sure how to make them the same.
Maybe by 'view' you mean client workspace? In which case the workspace selected by P4Win and p4 command-line are independent.
You need to use p4 set to select the same workspace for command-line as you've selected for P4Win.

In Perforce command line, how to diff a file reopened for add?

Suppose you open a file for branch to another place (without submitting), and then reopen it for add and make some edits. I would like to diff this edited version against its branch source in a script.
p4 diff2 is no good because one of the versions is in the client.
p4 diff is no good because it can only diff against the "corresponding" version of the file in the depot, which a branched unsubmitted file doesn't have yet.
Is there a way, or is the only option to just grab the two files and diff them using a third-party tool?
Sadly, you're on the money here, you'd need to use a third party diff tool to do this because, as you rightly pointed out, until you've submitted the initial integration to the depot, it doesn't have a copy against which to diff. If you go down this route you'd obviously not be able to access files directly in the depot though, you'd need to have both files on the client PC and specify their paths explicity.
ninesided is correct that you need to have both files on the client PC.
But there are shortcuts:
If you're using P4V, choose "Diff Against..." from the context or Tools menu. For 1st Path, choose the old location and select "Latest Revision'. For 2nd path, choose the new location and select "Workspace revision on local disk".
The work of selecting the paths can be made easier if you can get both files to appear in the same pane and Ctrl-click to multi-select. e.g. use the Workspace tree pane or open the source file for edit temporarily in order to get it listed in the Pending files pane.
P4V accomplishes this by running 'p4 print -o' on the depot file to create a temporary file on the client PC, then passing that temporary file to the diff application. If you need a textual diff, you can either configure P4V to run a textual diffing application, or run p4 print -o and diff yourself.

In Perforce, how do I get a list of checked out files?

How do I get a list of the files checked out by users (including the usernames) using P4V or P4?
I want to provide a depot location and see a list of any files under that location (including sub folders) that are checked out.
From the command line:
p4 opened -a //depot/Your/Location/...
The ... indicates that sub folders should be included.
Seeing as you also asked about P4V and only had command line answers so far, here's what you do for P4V. The "Pending" pane gets you part way to what you want. Ensure the "User" and "Workspace" filters are cleared, and you'll get a list of all files grouped by changelist and client spec. Not as clean as the straight list of files you get when using the P4 command line as suggested by Iain and Mark, but may help in some situations.
An alternative is to create a custom menu in P4V that uses one of the command line solutions suggested. For example:
Tools->Manage Custom Tools
New
Call it something e.g. Open files by user
Check the "Add to applicable context menus"
In Application field, browse to p4.exe
In Arguments, type opened -a %D (the latter takes the currently selected depot path)
Check the box to run in a console.
I'm sure you could fancy this up a bit if needed to filter the output.
You can also restrict the output of p4 opened like so:
p4 opened -C <client-spec> //depot/...
to get a list of files opened on that client-spec
p4 opened //depot/...
will give you a list of files opened by the current P4USER
In case you want to search for a particular user:
p4 opened -u the_user_name
In case you want to search for particular Changelist:
p4 opened -u the_user_name -c cl_number
I just want to point out something about about the command line arguments.
It is important to add the "/..." after the folder you want to look over because it will tell perforce to do it recursively.
So, I was trying this at the beginning :
p4 opened -a //myP4Path/dev_project
Which wasn't working until I did this:
p4 opened -a //myP4Path/dev_project/...
In p4v : try to do a rename of the top directory. You will get a warning and list of the currently checked out files with user names.

Resources