1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Support p4sync_flags and p4client_root variables for Perforce SCM (closes #10384)

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@8751 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2008-01-30 05:39:59 +00:00
parent f0fbbec55a
commit afe59d8076
2 changed files with 18 additions and 4 deletions

View file

@ -1,3 +1,10 @@
*SVN*
* Support p4sync_flags and p4client_root variables for Perforce [gseidman]
* Prepare for Net::SSH v2 by making sure Capistrano only tries to load Net::SSH versions less than 1.99.0 [Jamis Buck]
*2.1.0* October 14, 2007
* Default to 0664 instead of 0660 on upload [Jamis Buck]

View file

@ -25,21 +25,21 @@ module Capistrano
# destination directory. The perforce client has a fixed destination so
# the files must be copied from there to their intended resting place.
def checkout(revision, destination)
p4_sync(revision, destination, "-f")
p4_sync(revision, destination, p4sync_flags)
end
# Returns the command that will sync the given revision to the given
# destination directory. The perforce client has a fixed destination so
# the files must be copied from there to their intended resting place.
def sync(revision, destination)
p4_sync(revision, destination, "-f")
p4_sync(revision, destination, p4sync_flags)
end
# Returns the command that will sync the given revision to the given
# destination directory. The perforce client has a fixed destination so
# the files must be copied from there to their intended resting place.
def export(revision, destination)
p4_sync(revision, destination, "-f")
p4_sync(revision, destination, p4sync_flags)
end
# Returns the command that will do an "p4 diff2" for the two revisions.
@ -89,7 +89,6 @@ module Capistrano
# a fixed destination so the files must be copied from there to their
# intended resting place.
def p4_sync(revision, destination, options="")
p4client_root = "`#{command} #{authentication} client -o | grep ^Root | cut -f2`"
scm authentication, :sync, options, "#{rev_no(revision)}", "&& cp -rf #{p4client_root} #{destination}"
end
@ -109,6 +108,14 @@ module Capistrano
variable(:p4passwd) || variable(:scm_password)
end
def p4sync_flags
variable(:p4sync_flags) || "-f"
end
def p4client_root
variable(:p4client_root) || "`#{command} #{authentication} client -o | grep ^Root | cut -f2`"
end
def rev_no(revision)
case revision.to_s
when "head"