Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 29 lines (23 sloc) 536 Bytes
#!/bin/bash
#
# Usage: p4-move-dir OLD_DIR NEW_DIR
#
# Moves a p4 directory to a new location.
#
# Written in 2007 by Suraj N. Kurapati <https://github.com/sunaku>
src=$1
shift
dst=$1
shift
for i in $(p4 have $src/... | sed 's,\#.*,,; s,^'$( p4 where | awk '{print $1}' | sed 's,\.\.\.$,,' | head -1 ),,)
do
x=$src/$i # src file
y=$dst/$i # dest file
d=$dst/${x%/*} # dest dir
mkdir -vp "$d" &&
#mv -vf "$x" "$y" &&
#p4 delete "$x" &&
#p4 add "$y"
p4 integrate "$x" "$y" &&
p4 delete "$x"
done