p4v cannot see the default tree in pending tab - perforce

I am new to P4V (perforce) while working with this, i cannot see the default folder in pending tab as i cannt drag any files for editing.
Thanks

Have you created a workspace? Open workspaces tab > right click.
Also make sure your connection is set up properly.

Related

Recovering files deleted by Android studio?

I'm working on an app at the moment, and one of the final steps was to get it built and signed in Android studio.
Unfortunately I was having some problems, and one of the recommended solutions was to remove the project and start again, however when I did this it took all of my files with it, and they're not in the trash (OSX) either.
Is there anyway to recover these files, or are they lost forever? :(
In my case I was looking for the file named 'landing_page222.java' which I deleted one day back.
Following Steps can help you to find your previously deleted files in Android Studio.
Step 1: Right Click on the folder where you deleted the file
Step 2: Find option for Local History and Click Show History.
Step 3: Find your File from Given List.
Hopefully it will be available in Instance
Step 4: Copy the code back as per need.
You can try:
looking for those files in the file system (perhaps they are still in your Android Studio projects folder)
looking in your OS's temp folder
using Android Studio's history feature (right-click on the Project tab > Local History > Show history)
Click whereever you want in the left frame (for example "drawable" file is ok) and then press CTRL+z. You are going to see "Undo delete popup" window.
And as you understand, when you press CTRL+z in Android Studio, which (XML or Java) file is active, you will undo the action on that tab. So, if you click any file on the left side and press the CTRL+z combination, you will undo the action at the file structure.
Go to View > Recent Changes > Click on the file you want to recover > Click "Revert"
Im late but this works. Go to the folder where u want to recover. right-click, local history. select ones you deleted and click revert. :)

P4V Clear the drop-down menu in the tree view for workspaces

In P4V (Perforce visual client) there is a tree view, where you can browse your files. In the top of that view, there is a dropdown menu, where you can select the workspace you want to browse through.
I have just deleted a whole bunch of old workspaces, but they still show up in the drop-down menu. I cannot find any place to get rid of them.
I will be happy to know how to either:
remove specific workspaces from the drop-down, or
remove all workspaces from the drop-down
I used P4V Rev. Perforce Visual Client/MACOSX106X86_64/2014.1/827578 and had 10 workspaces listed in the drop down. As I deleted them they were removed from the drop-down. What version of P4V are you using?
I am using P4V (on Windows 7), dated 2013 March 20 and versioned:
Rev. Perforce Visual Client/NTX64/2013.1/611291
My problem was somewhat different than that described in the question. A number of my old workspaces were showing up in the P4V workspace drop-down menu, even though these old workspaces no longer existed on the server. (I did not delete those workspaces; I'm guessing they were deleted by an admin.)
In my case, I found a way to remove these orphaned names from the workspace drop-down menu. Here's what I did: For each workspace name in the drop-down menu I wanted to remove, I:
Recreated a workspace with the identical name. (I found that the root folder that I assigned to the workspace did not matter.)
Immediately deleted the workspace.
This resulted in the workspace name being automatically removed from the workspace drop-down menu.

What happened to "Exclude from Source Control" in VS2012

I want to exclude some of the files in code folders from TFS 2012 source control.
Before VS2012 this was done by the "Exclude from source control" command available in "Source Control Explorer"s right-click menu. But in VS2012 I can not find it.
Does anybody know where it is ?
(I am using a "Local" workspace by the way.)
When you click on "Detected Changes" in the Team Explorer pane, "Promote Candidate Changes" window opens. This window allows you to select among detected changes and promote them to a source controlled item.
In this "Promote Candidate Changes" window, you select a file (or multi select files with Shift), right-click on it and a context menu pops up which contains an "ignore this local item" option. If you you click on it, selected files are excluded from source control.
Visual Studio adds a file named ".tfignore" to the source control mapping root, which contains names of all files to be ignored by source control. (Previous TFS versions did not produce this file but they were all server workspaces. Since this is a "Local" workspace, filenames to be ignores need to be kept in the workspace)
I have the real solution.
In the "team explorer" pane, in the "pending changes" tab, right click a new file you don't want in source control, and click "undo".
It will leave the file in the project, and exclude it from TFS. In the project window, the file will never have a "lock" icon on the left of its name.
This is the easiest solution:
1. Select the file(s) in Solution Explorer
2. Go to File -> Source Control -> Advanced
and here it is
Keep in mind:
If you right click a file in Solution Explorer you only find "the most important options" not all :)
In VS2013 this is back but has been moved to the file menu: -
Select the file in the Solution Explorer
File > Source Control > Advanced > Exclude xxx.xxx from Source Control
I know that this is slightly off topic but thought it may help someone.
I have Visual Studio 2017 Enterprise, and the option to exclude does not exist under File->Source Control. My solution to this problem was to open the Source Control Explorer, and remove the item I wanted to exclude.
It's in the Pending Changes pane separated to Excluded Changes and Included Changes sections. It allows filtering and excluding or promoting items between sections.
!

Perforce: P4V option to 'add to client view'? (It exists in P4Win)

In the Perforce realm, the P4Win GUI is now "legacy" and the new P4V is supposed to fill in the void (and it does, most of the time).
There was one very useful (albeit rather hidden) option in P4Win that allowed adding a depot path to the client specification in a few clicks.
Is there a similar option available in P4V? ... because I can't find it.
(I know I can do it manually.)
Here is the P4Win feature, in all its glory:
This is typical for the P4 GUI (old and new) - it can do lots of things, if only you knew where to look (hint: usually not where you'd expect to find it).
There IS an option in P4V similar to the old 'Add Files to client view' from P4Win, only a lot more powerful! (it's a bit hidden and IMO not as streamlined as the original)
You can't find it in the depot view, where you probably ARE when you need it. Instead, go to Workspaces view, right-click the workspace definition and 'Edit' it (or dbl-click it then click 'Edit').
Notice the tabs on top of the 'Workspace editor' window that just opened. Select the 'View' tab. There is a lot going on here, including (apparently) information on the new 'Offline' mode.
To get to the point: in this window, find the piece of depot you need and right-click it.
Nirvana! There are no less than 6 menu options (!) that allow you to specify how and what to add OR remove to/from the workspace definition.
There's even an 'advanced' mode that looks a bit scary :-&
For P4V version : Rev. Perforce Visual Client/LINUX26X86_64/2012.1/490402
Released on 2012 July 02
Do as follows
Go to Connections -> Edit Current Workspace
In the Basic tab , Workspace Mappings , Right click on the tree and Include Tree.
I don't think that there is, you need to open the Workspace view and make your changes there.
Edit your workspace and change the view to include the relevant directory. Although I use P4V everyday and 'Add to client view' seems to ring a bell....
Of note, they added this feature into the P4V client at some point. You can now right click on a path in the depot tab and choose "Map to Workspace View...". It will bring up the workspace editor with the path added.

How to delete a workspace in Perforce (using p4v)?

I'm new to Perforce and have created a few workspaces as exercises for getting familiar with it. Now I would like to delete some of the workspaces. I just want to get rid of the workspaces so that they do not appear on the drop-down in the workspaces view (do not want to do anything with actual depot files).
Googling up an answer yields the suggestion to "make the workspace active" (I guess that means select it in the workspace dropdown?) and then delete it from the "edit" menu. Unfortunately, the delete option is grayed-out when I try this.
Anyone know how to do this, or do I just have to live with junk workspaces? I've physically deleted one of them from the disk, and it still appears in the workspace drop down, and I can't even synchronise it with the depot now, so I guess that's not how to do it.
From the "View" menu, select "Workspaces". You'll see all of the workspaces you've created. Select the workspaces you want to delete and click "Edit" -> "Delete Workspace", or right-click and select "Delete Workspace". If the workspace is "locked" to prevent changes, you'll get an error message.
To unlock the workspace, click "Edit" (or right-click and click "Edit Workspace") to pull up the workspace editor, uncheck the "locked" checkbox, and save your changes. You can delete the workspace once it's unlocked.
In my experience, the workspace will continue to be shown in the drop-down list until you click on it, at which point p4v will figure out you've deleted it and remove it from the list.
It could also be done without a visual client with the following small script.
$ cat ~/bin/pdel
#!/bin/sh
#Todo: add error handling
( p4 -c $1 client -o | perl -pne 's/\blocked\s//' | p4 -c $1 client -i ) && p4 client -d $1
In P4V click View > Workspaces
If the workspace to be deleted is not visible in the list you may have to uncheck the box Show only workspaces available for use on this computer
Right-click the workspace to be deleted and choose Edit Workspace 'My_workspace'
On the Advanced tab uncheck the box Locked: only the owner can edit workspace settings > then click OK
Now back on the Workspaces tab of Perforce right-click the workspace to be deleted and choose Delete Workspace 'My_workspace'
P4V should remove the item from the drop-down list when clicking on it.
There is a case where a previously deleted workspace remains in the drop-down list, and P4V displays the following error:
P4V Workspace Switch Error. This workspace cannot be used on this computer either because the host field does not match your computer name or the workspace root cannot be used on this computer.
If this error occurs, the workspace(possibly on another host) may have only been unloaded. Click the P4V Workspaces Recycle bin
In the resulting Unloaded Workspaces window right-click the offending workspace and choose Delete Workspace 'My_workspace'. P4V should now remove the workspace item from the drop-down list.
If you have successfully deleted from workspace tab but still it is showing in drop down menu. Then also you can successfully remove that by following these steps:
Go to C:/Users/user_name/.p4qt
user_name will be your username of your computer
Inside 001Clients folder WorkspaceSettings.xml file will be there.
There will be two tag
varName = "RecentlyUsedWorkspaces" remove the deleted workspace tag
A propertyList tag will be there with varName=deleted_workspace_name
delete that tag.
from drop down menu workspace name will be deleted
Ctrl + 5
Delete the relevant workspace

Resources