|
|
@@ -1,6 +1,7 @@
|
|
|
export P4EDITOR="${EDITOR}"
|
|
|
export P4DIFF="${EDITOR} -d"
|
|
|
export P4MERGE="${EDITOR} -d"
|
|
|
+# May be overridden in ~/.profile-local or other such file
|
|
|
: ${P4_MAIN_ROOT:="//depot/"}
|
|
|
export P4_MAIN_ROOT
|
|
|
|
|
|
@@ -31,14 +32,19 @@ p4whose() {
|
|
|
}
|
|
|
|
|
|
p4backout() {
|
|
|
+ if [[ $# -lt 2 ]]; then
|
|
|
+ echo "usage: p4backout backout# parent#" >&2
|
|
|
+ return 1
|
|
|
+ fi
|
|
|
local changenum="$1"
|
|
|
- local target_stage="${2:-fdsparent}"
|
|
|
+ local target_stage="@${2}"
|
|
|
+ if [[ ${target_stage} == "@HEAD" ]]; then target_stage=""; fi
|
|
|
local lastchange=$((changenum-1))
|
|
|
p4 sync @$lastchange
|
|
|
p4 edit ...
|
|
|
p4 sync @$changenum
|
|
|
p4 resolve -ay
|
|
|
- p4 sync @$target_stage
|
|
|
+ p4 sync $target_stage
|
|
|
p4 resolve -am
|
|
|
}
|
|
|
|
|
|
@@ -52,6 +58,7 @@ p4_import_changelist() {
|
|
|
local client=$(grep -E "^Client:" "${tmpfile}" | awk '{ print $2 }')
|
|
|
local files=($(IFS=$'\n'; p4 describe -s "${changelist}" | grep -E "^\.\.\." | cut -d' ' -f2- | cut -d'#' -f1))
|
|
|
|
|
|
+ # Initialize the client if necessary (a client with no files in view will not always have a View header)
|
|
|
local has_view=$(grep -c -E "^View:" "${tmpfile}")
|
|
|
if [[ $has_view -eq 0 ]]
|
|
|
then
|