tags:

views:

318

answers:

2

Quite often when I'm working in a branch in Perforce, I realise I need a file I didn't branch when I initially branched.

So, I add the file to my client, run p4 integrate -b branchname, then p4 submit.

Thing that bugs me is that I then need to go through the list of files for submit, and remove all entries that are open for edit.

I can't see any option in p4 help submit, but it seems like this might be a reasonably common use case.

+1  A: 

You can choice to submit a single file on the command-line.

p4 submit <filename>

Then it won't bug you about the other files.

If you have more than one file, then maybe you should move all of the files you are currently editing onto an numbered changelist, or branch onto a numbered changelist, which will provide the separation you want. If you're going to do this, it's much easier to manage numbered changelists from one of the GUIs.

Douglas Leeder
+1 - Yeah, that often does the trick, but not when I've got a bunch of files open for branch, really looking for more general solutions.
Dominic Rodger
Well you described it as a problem of a single file.
Douglas Leeder
So I did - fair point. Sorry, the question I asked wasn't quite what I was intending!
Dominic Rodger
In that case, numbered changelists, and a GUI client are the way to go.
Douglas Leeder
+2  A: 

First do

p4 submit

Assuming your p4 editor is vi,

type this command in command mode

g/#.*edit\|#.*add\|#.*delete/d
Viswanadh
If you want to know what your editor is type $P4EDITOR in your terminal
Viswanadh
+1 - That's an interesting approach. I use emacs, but I could readily adapt your regex.
Dominic Rodger