May 6, 2015

Ten Time Savers in 2015.1

Helix Core
With all the big changes in the 2015.1 release you might have missed some of the smaller features potentially saving you precious time (and keystrokes). Here are ten of them, fresh from the release notes:
#968391 (Bug #74665) **
   'p4 rec' is a now a synonym for 'p4 reconcile'.

By popular demand, you now have to type only half as many characters to run a reconcile.


#967271 (Bug #75557) **

   Now 'p4 status' displays files already opened in addition to
   files that need to be reconciled.

Often when checking "status" to see what files you've modified, you're interested in seeing not just the files you haven't opened yet but the files you already have. Now there's no need to run a "p4 opened" on top of a "p4 status" to get the full picture.


#963444 (Bug #65298, #74627) **
   The new 'mergeany' stream option allows flow rules for 'p4 merge'
   to be ignored for a particular stream.  The default option of
   'mergedown' preserves the previously existing flow rules.  Streams
   created by 'p4 switch' on a personal server use 'mergeany'.

The "mergeany" option allows you to use a "merge up, merge down" flow of change without needing to remember to use "-F" on the merges that go in what would normally be the "copy only" direction.

#962982 (Bug #75562) **
   New simpler syntax for 'p4 merge' with streams.  If no arguments are
   specified, the target defaults to the current stream, and the source
   defaults to the current stream's parent.  A different source can be
   specified with '--from STREAMNAME', which is an alias for '-P'.  The
   stream may be specified as a directory name relative to the current
   stream depot, e.g. '--from main' instead of '--from //Ace/main'.
This new syntax makes the average "p4 merge" command line much simpler -- to merge from the parent stream, just do "p4 merge", and to merge from another stream, just do "p4 merge --from other".
#952949 **
   'p4 sync' will now automatically resolve files where the previously
   synced version does not differ from the newer depot revision.

This is a nice little time saver when syncing open files that have had content-free edits made to them, but more importantly, it makes the new "p4 sync -r" (see below) not require a bunch of resolves when you're reopening your files in an unmodified branch.

#946084 (Bug #64757) **
   'p4 revert' now supports a new flag '-C client'. This flag allows 
   a user with admin privilege to revert files opened in another

Previously to revert another user's files it was necessary to login as them (requiring super access) or delete their entire client, but the new "-C" option makes it easy for admins to deal with users who have done things like exclusively check out a file and then go on vacation.


#936955 (Bug #75207) **
   'p4 reconcile' will now detect files that are open for delete but
   are physically present on the client, and reopen them for edit.

The converse of a similar change made in a previous release -- now "reconcile" (or "rec") can handle this particular case without first needing a "revert -k" to reset the file.

#907436 **
   The new '-r' flag for 'p4 sync' permits pending work to be carried
   over to a different file when the client view is changed.  For 
   example, pending work can be moved to a different stream by running
   'p4 client -f -s' followed by 'p4 sync -r'.

The "sync -r" command underlies the new "switch -r" functionality allowing open work to be carried over to a new stream when switching, but it can also be used with custom client views, permitting you to easily relocate your work in progress without needing to mess around with shelves and branch views.

#901864 * **
   'p4 status -s' previews files needing reconcile, but lists
   files to be opened for add in subdirectories rather than

Running "p4 status" but not looking forward to scrolling through all the files in that giant directory you just added to your workspace? Give the new "-s" flag a try.

#900158 (Bug #68860) **
   'p4 add' now traverses the workspace when given a file argument
   containing '...', similar to 'p4 reconcile -a'.

Since the addition of "reconcile" it's technically been fairly easy to recursively add a directory of files, but now that there's support for a client-side "..." wildcard in "p4 add," you don't need to remember to use a different command when you're operating on a directory.