-
Notifications
You must be signed in to change notification settings - Fork 0
/
p4-sync-last-nondeleted
executable file
·39 lines (33 loc) · 1 KB
/
p4-sync-last-nondeleted
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# $Id$
# TODO: convert this to a P4cmd perl script
case $# in
0 ) echo Cowardly refusing to sync everything. 1>&2
exit 1 ;;
esac
p4 fstat -T clientFile,headAction,headChange "$@" |
while read dots field data; do
case $field in
*File ) file=$data ;;
*Action ) act=$data ;;
*Change ) chg=$data ;;
esac
case $dots in ... ) continue ;; esac
case $act in
archive | purge ) echo Cannot sync ${act}d file "$file" 1>&2 ;;
*delete ) echo "$file"@$((chg - 1)) ;;
* ) echo "$file"@$chg ;;
esac
done |
p4 -ztag -x - sync |
while read dots field data; do
case $field in
action ) act=$data ;;
change ) chg=$data ;;
clientFile ) file=$data ;;
rev ) rev=$data ;;
esac
case $dots in ... ) continue ;; esac
printf "%-9s %8d %s#%s\n" "$act" "$chg" "$file" "$rev"
done
# eof