mjcrouch/vscode-perforce

Allow to select specific changlelist on file operations

evg656e opened this issue · 3 comments

If there is more than one changelist in the workspace, allow to select the desired changelist, like it is done in p4v.

select_pending_changelist

Hi,

Thanks for the suggestion, this is something I've thought about previously.

I think choosing the changelist as you perform the action might be a little difficult to implement in a consistent way that a user would understand. For example if you have the extension set to automatically open a file every time you edit it, then we would have to either prompt the user on every save or just always open in the default changelist on save, which is not very consistent. That's not to rule this approach out - It might not be as confusing as I think.

IIRC the jetbrains perforce plugin and maybe eclipse or visual studio plugins have something like a "target" changelist that you choose in advance, so whenever you open or add a file it puts it in to that changelist by default. This might be easier to implement but I think it is still challenging to come up with a consistent behaviour that works without weird errors. - particularly if you also use an external perforce client to perform actions (e.g. your target changelist might be submitted externally).

So to summarise, I think it could be a useful addition, but needs some careful thought and may take some time to implement

For example if you have the extension set to automatically open a file every time you edit it, then we would have to either prompt the user on every save or just always open in the default changelist on save, which is not very consistent.

imo it would be fine to show prompt only when file editing is invoked from vs menu (otherwise files should go into default changelist, at least this is how the official client works).

IIRC the jetbrains perforce plugin and maybe eclipse or visual studio plugins have something like a "target" changelist that you choose in advance, so whenever you open or add a file it puts it in to that changelist by default

it's a good option too (at least in case when you mainly work with one changelist in a time)

+1

If we can mark a specific change list/workspace folder, as target change list, that will be great. I may submit a PR.