Perforce Guilty

Is there any svn guilt equivalent for Perforce on the command line? p4 annotate does not display usernames - only changeset numbers (without ancestor history!).

Currently, I have to track the code back through my ancestors and compare it with the file archive, but there just has to be an easier way - maybe the F / OSS utility?

+46
version-control svn perforce
Sep 11 '08 at 19:55
source share
6 answers

Try looking at a few tools that I think can help you the most:

1) p4pr Perl script by Bob Sidebot and Jonathan Kamens.

2) The Emacs Perforce interface has the command 'p4-print-with-rev-history' (attached to `Cx p V '),

+10
Sep 11 '08 at 20:30
source share
โ€” -

I am not too familiar with the guilty team, but I assume that you are looking for someone who modifies a specific line of code. The easiest way is to use Perparce 'time lapse view', available from both p4win and p4v.

This tool uses annotation and some other commands to give you an idea of โ€‹โ€‹the code line over time. You can see who changed which code, when it was inserted or removed from the code line, etc.

This is not a command line. I checked briefly in the help, and there seems to be no way to start a temporary viewer view directly from a p4win or p4v call. Maybe, though ... I will check further ...

Edit: I checked with support, and you can start a timed view using p4v as follows:

 p4v.exe -cmd "annotate //<path/to/file>" 

NTN.

+54
Sep 11 '08 at 20:19
source share

I use a small script to charge

 #!/bin/bash FILE="$1" LINE="$2" p4 annotate -cq "${FILE}" | sed "${LINE}q;d" | cut -f1 -d: | xargs p4 describe -s | sed -e '/Affected files/,$d' 

you can connect it to some editors that will pass the file name and line.

Here's a slightly more complicated version here .

+4
Aug 15 '14 at 13:35
source share

From the p4v client you can get the "Time-lapse View" context menu in the entire view displaying a file such as Files, Changelist, etc.

In the temporary view, there are many options, such as Single Revision, Multiple Revision, for analyzing what was changed, when and by whom.

+3
Oct 02
source share

@ alanw123: p4pr is close to what I'm looking for, but it does not cross branch boundaries:

 last if $type eq 'branch'; 

This was the main problem that I encountered when I was trying to write my own utility - you cannot (easily) tell how the lines will return to the file that was forked.

+1
Sep 11 '08 at 21:07
source share

The p4 annotate command can actually follow joins / unions and branching on the command line with the -I and -I commands (but it cannot execute both at once :():

 -I Follow integrations into the file. If a line was introduced into the file by a merge, the source of the merge is indicated as the changelist that introduced the line. If that source was itself the result of an integration, that source will be used instead, and so on. The use of the -I option implies the -c option. The -I option cannot be combined with -i. -i Follow file history across branches. If a file was created by branching, Perforce includes revisions up to the branch point. The use of the -i option implies the -c option. The -i option cannot be combined with -I. 
+1
Apr 18 '13 at 16:57
source share



All Articles