[p4] Stopping notepad popup of tmp files while running change and other commands.
perforce-user-forum at forums.perforce.com
Thu Apr 9 12:10:01 PDT 2015
Posted on behalf of forum user 'P4Sam'.
Okay, assuming I can just leave the "client -t" out without missing
anything important, I think this is what you want to do:
p4 set P4CLIENT=[clientname] p4 client -s -S [streamname] p4
sync This switches your client to the stream "[streamname]" and then
syncs everything in the stream. Note that the "-s" flag
(for "switch") switches the client without invoking an editor.
To answer the more general question about how to avoid invoking an editor (e.g.
for "p4 change"), an easy way to think of it is that when you run:
p4 change it's the same as if you ran:
p4 change -o > tmpfile.txt notepad tmpfile.txt p4 change -i < tmpfile.txt
So if you want to skip the part where you invoke Notepad, run "p4 change
-o" and "p4 change -i" and do something else in between to edit
the spec. The "-o" and "-i" flags work the same
for every command that edits a spec -- the "-o" outputs the
existing/default spec (without modifying it), and the "-i" inputs the
new spec (saving it on the server). In between the two if you're
not invoking an editor you'll need to come up with some other way to modify
My personal favorite method is to use a Windows version of 'sed' and
pipe the spec through it rather than dealing with temp files:
p4 change -o | sed -e "s/<.*>/my description/" | p4 change -i
Please click here to see the post in its original format:
More information about the perforce-user