Simple, lightweight Visual Studio plugin to run various Perforce commands on files, such as checkout and revert. Includes optional auto-checkout feature.
Getting stderr: file(s) not on client when checking out/performing any actions on file paths with spaces in folder/file names.
Should work if we surround filePath in Commands with quotes ""?
P.S. Thank you! Was looking for a lightweight Perforce plugin and found this in the Visual Studio Marketplace! Love it!
I've noticed in my Unreal Engine project that randomly, Visual Studio for some reason loses the case accuracy of the file path. I can see this even by right clicking on a file and selecting "Copy Full Path". Unfortunately, it looks like P4 command line is case sensitive for file paths. That means that sometimes, P4EditVS works fine... but at some point this breaks and it gives the error "file(s) not on client." when I try to perform any p4 operations and will continue this trend until I re-open the solution.
Is there possibly a way you could fix this by grabbing the correct casing for a given filepath from the disk?
When possible - so, definitely at least when invoked from an editor tab - invoke as p4vc -l LINE FILE. The -l flag opens the time lapse view with the given line highlighted, and also enables line numbers by default.
The output window swaps to P4EditVS's output pane when the solution settings are loaded.
As the plugin is async loaded it can take quite a while for it to be initialized meaning it can take focus in the middle of doing something such as building.
Try to see if there's a way to not take focus or initialize earlier if possible.
This message box (and in fact any dialogs like it...) should have whatever flags added that mean the user can press Esc to get back to where they were, with no action taken.
I think it would be better if this uses the existing instance of P4V instead of opening a new one. This could be a configurable option if needed, though I think making it use the existing instance by default would be best.
I was wondering if you could provide an option for user to have all the per item p4editvs options under a submenu (the same way you do for the solution explorer).
Right now the p4editvs options nearly doubles the size of the menu.
So basically if we can do this (as an option, that would be greatly appreciated).
Since this plugin is for visual studio, I wanted my diffs to also appear in visual studio, instead of opening in a seperate program. However, the diffs seem to always open using P4V's diff tool, even if I specify for them to use Visual Studios' diff tool in P4V's preferences.
P4EditVS should either allow configuration to open diffs in Visual Studio, or it should respect whatever is set in P4V preferences.
Hi! I love this extention, but sadly it doesn't work reliably with the 'open folder' feature. I was wondering if you could add support for this? Cheers!
First of all Thanks for the addon,
When checking out a file, it will be great if you can add an option to
1- create a new changelist
2- select an existing changelist
Hello!
First of all, I use Workspaces instead of 'Allow Environment' functionality. I noticed that when I specify workspace in settings, it successfully saves and after reload we can see it again. To work in certain workspace, I have to select it in Extensions -> P4EditVS -> [MyWorkspaceName]. But when I close my project and reopen it later, I notice that I still have to select it in Extensions (see screenshot below). It would be good if you add option 'Default Workspace on startup' which connects to specified workspace automatically on vs load (because I always set it manually)
This dependency doesn't seem to be installable, either through the VIsual Studio Installer or otherwise. I've seen references to it on stack overflow in being an old dependency that's no longer important to include in the visx. Is there a workaround? VS2022 seems to work fine, but I need VS2019 available as well.
If you go to check out something whose kind is GUID_ItemType_PhysicalFile, how about if P4EditVS checked out everything in its ProjectItems array (and recursively)? Looks like that would fix this case.
Maybe extend this for folders too? Feels like it'd perhaps end up too easy to check out too much.
In P4V 2024.1 with "bug fix" #119251, they changed the command line for the Open in P4V functionality. Rather than p4vc -s <file name> you must now use p4vc workspacewindow -s <file name> or you get a popup error message.
One upside of fixing this is you can close #36 as this is the new behavior.
For completeness, here is the note from the P4V revision history:
#119251 (Change #2555854)
'p4v -s', and 'p4v -t' now tells you to run 'p4vc workspacewindow -s', or 'p4vc
workspacewindow -t'. The workspacewindow provides the same functionality as
running P4V. If you run 'p4vc workspacewindow -s ' and a
workspacewindow is already running connected to that client, it brings the
application to the foreground and selects that file in either the workspace or
depot tree instead of opening a second window.
Using ctrl+s to save can frequently cause the file save as dialog to appear even when the file is checked out.
Disabling the extension does stop this from occurring.
Environment:
Windows 11, up-to-date
Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.8.1
P4V Rev. P4V/NTX64/2023.3/2495381
Project is checked out with default settings (e.g. read-only means not checked out, etc).
It's being reported that even though Use Environment is selected in one solution it is not using the .p4config file to get the correct P4 environment.
I tried a different solution, and it also crashed. Got an error message from perforce in the process: Path 'e:\perforce\new_solution\new_file.cpp/...' is not under client's root 'D:\dev\perforce\original_solution'.
Both solutions have a .p4config set up, and Use Environment is true, so I guess the environment variables are pointing at original_solution or something? Shouldn't it use .p4config though?
It would be nice to have the option to select from my existing pending CLs when prompted for check out/add/delete, and have the file added to that CL (similar to how p4vs does it). This could also provide the option to create a new CL, although that's a lesser QoL feature.
An alternative to this would be to have an 'active' CL that the user can define (perhaps on a toolbar or via a menu), and then all check out/add/delete operations will use that CL. This would be an improvement on p4vs, which prompts for CL every single time. ๐
As reported on the VS marketplace, I'm getting a crash when I use Open in P4V on a file in my solution (.h or .cpp). P4V opens up fine, and selects the appropriate file but almost immediately after, VS locks up, and about 10s later force closes and reloads the solution. I'm then informed that
I'm using VS Pro 2019 (Version 16.9.6). It crashes whether I use Open in P4V on the tab context menu, or on the main menu option. I do not have it set up as a keyboard shortcut. I enabled devenv logging, but annoyingly nothing appeared in the log.
Is it possible to support for "Auto-Checkout On Paste" ? I have enabled "Auto-Checkout On Edit", but it won't be affected on ctrl+v. Typing is working well.
It would be nice if P4EditVS came with a Toolbar. I know it's possible to create your own (and have done so, see picture below) but then if I am on a different machine I don't have it automatically when I install the extension. One possible suggestion for the layout of the toolbar is to put the 'text-only' items in a sub menu:
I have also grouped the 'operates on this file' options separately from the 'alternate views of this file' options, hence the separator to the left of the 'History' icon.
There's currently a bug where for some projects the .filters file is not checked out at the same time making it awkward to add new or existing files to a project.