#!/bin/bash
NOW="/tmp/now_tmp"
BEFORE="/tmp/before_tmp"
LABEL=$1
USAGE="usage: "${0%}" [label]"
if [ "x$LABEL" == "x" ]; then echo $USAGE; exit; fi
p4 changes -l -i ./... > $NOW
p4 changes -l -i ./...@$LABEL > $BEFORE
for change_num in $(diff $NOW $BEFORE | perl -lne'/. Change (\d+)/ && print $1');
do
p4 describe $change_num |perl -pne'do { print "-----------------------------------------------------------\n\n"; exit } if m{Differences \.\.\.}'
done
A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.
Jump to
Showing posts with label p4. Show all posts
Showing posts with label p4. Show all posts
How to list differences between Perforce labels
Find files in workspace that perforce doesn't know about
for file in `find . -type f`; do p4 diff -f ./$file; done | grep "not on client" | sed 's/on client/in depot/'
But the sed part doesn't work (wrong stream?)
Labels:
bash,
cvs,
p4,
productivity
Set file modes in Perforce
Perforce.
Edit a file and:
or if it's already being edited:
p4 reopen -t text+kxw
+w always writable on client
+x exec bit set on client
+k $Keyword$ expansion of Id, Header, Author, Date, DateTime, Change, File, Revision
+ko $Keyword$ expansion of Id, Header only
+l exclusive open: disallow multiple opens
[full article]
Edit a file and:
- explicitly set RCS keywords to be expanded (k)
- have the executable bit set (x)
- always be writeable on the client (w)
or if it's already being edited:
p4 reopen -t text+kxw
See also
p4 help filetypes
+w always writable on client
+x exec bit set on client
+k $Keyword$ expansion of Id, Header, Author, Date, DateTime, Change, File, Revision
+ko $Keyword$ expansion of Id, Header only
+l exclusive open: disallow multiple opens
[full article]
Labels:
cvs,
p4,
rcs keywords
Perforce commands
p4 sync -f ./...
p4 diff -f [file]
p4 filelog -l -i -t [file] // complete history (-l = long text, -i = follow branches, -t = include times)
p4 annotate [file] // show file with changes marked
Tagging
// NOTE: If no revision specified, the head revision will be tagged
p4 tag -l ProjectName_R01 [filename]#revision // tag a specific revision of a file.
p4 files @ProjectName_R01 // list files on a tag
Labels:
cvs,
linux,
p4,
productivity
Subscribe to:
Posts (Atom)