[p4] [Creating a new head revision with a single click]

Smith, Jeff jsmith at medplus.com
Wed May 30 16:54:19 PDT 2007


Personally, I think making this a "single click" operation is a bad
idea.  It's fairly "destructive" to the history and is something that
shouldn't happen too often in a stable SCM/CMS process.  You might take
a look at what gets you into needing to do this so often and try to
attack the root cause.

And I can't remember the last time I felt the need to perform this
operation on a single file.  I suspect that you probably do this to
several files in a row in which case you should be building a changelist
and submitting those reversions as a single change.  So I would suggest
that you make a one-click operation to make the changes but the
submission should be a separate act.  That just feels more Perforce-ish.
There's a reason that there is no single-click delete (or add for that
matter): single file operations are a pretty rare occurrence.

Jeff 

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Jeff Grills
Sent: Wednesday, May 30, 2007 5:02 PM
To: Mark.Bonfiglio at smsc.com; perforce-user at perforce.com
Subject: Re: [p4] [Creating a new head revision with a single click]


You haven't indicated what environment you're working in.  I don't think
that p4win nor p4v can be extended in this manner.  So, thinking about
an external tool to do this, you need at least a click to invoke the
tool from a gui, and you have to select the revision you want to make
the head revision, which seems like at least two mouse clicks. Assuming
that's okay, it shouldn't be hard to write an app that gets all the
revisions, presents it in a list, and lets you select a revision to
re-submit as head.  The steps you've outlined below seem correct,
although to my knowledge there's no reason to actually modify the file
and add whitespace as long as you merge with -ay.  In your specific
example, you'd issue these commands:

(make sure the file isn't already open)
p4 sync file#4
p4 edit file
p4 sync file
p4 resolve -ay file
p4 submit -d "Resubmitting revision 4 as head revision" file

Note that the -d option to submit requires a 2006.2 or newer server.  On
older servers you'd have to construct the changelist comments manually
and use submit -i.

Good luck.

j

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of
Mark.Bonfiglio at smsc.com
Sent: Wednesday, May 30, 2007 3:25 PM
To: perforce-user at perforce.com
Subject: [p4] [Creating a new head revision with a single click]

Hello,

I'm looking for single-mouse-click solution to make one revision of a
file the new head revision.

My current method is a bit cumbersome.  For example if I have a file
that has 10 revisions, and I want to make revision 4, the new head
(essentially becoming revision #11) I do the following:
                Check out revision 4
                Make a simple edit to rev 4 (usually add whitespace)
                Get latest revision from depot (this sets up a conflict)
                Resolve the conflict, making my file the new head
                Submit the change

What would be nice, is a right-click menu option titled something like
"Make new Head Revision" that performs the above operations.

Is there a plugin that does this? Or does anyone know how to automate
these steps?


Thanks for any tips

-Mark
_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user

_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user



More information about the perforce-user mailing list