| Class | Capistrano::Deploy::SCM::Perforce |
| In: |
lib/capistrano/recipes/deploy/scm/perforce.rb
lib/capistrano/recipes/deploy/scm/perforce.rb |
| Parent: | Base |
Implements the Capistrano SCM interface for the Perforce revision control system (www.perforce.com).
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.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 27
27: def checkout(revision, destination)
28: p4_sync(revision, destination, p4sync_flags)
29: 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.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 27
27: def checkout(revision, destination)
28: p4_sync(revision, destination, p4sync_flags)
29: end
Returns the command that will do an "p4 diff2" for the two revisions.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 46
46: def diff(from, to=head)
47: scm authentication, :diff2, "-u -db", "//#{p4client}/...#{rev_no(from)}", "//#{p4client}/...#{rev_no(to)}"
48: end
Returns the command that will do an "p4 diff2" for the two revisions.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 46
46: def diff(from, to=head)
47: scm authentication, :diff2, "-u -db", "//#{p4client}/...#{rev_no(from)}", "//#{p4client}/...#{rev_no(to)}"
48: 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.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 41
41: def export(revision, destination)
42: p4_sync(revision, destination, p4sync_flags)
43: 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.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 41
41: def export(revision, destination)
42: p4_sync(revision, destination, p4sync_flags)
43: end
Determines what the response should be for a particular bit of text from the SCM. Password prompts, connection requests, passphrases, etc. are handled here.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 64
64: def handle_data(state, stream, text)
65: case text
66: when /\(P4PASSWD\) invalid or unset\./i
67: raise Capistrano::Error, "scm_password (or p4passwd) is incorrect or unset"
68: when /Can.t create a new user.*/i
69: raise Capistrano::Error, "scm_username (or p4user) is incorrect or unset"
70: when /Perforce client error\:/i
71: raise Capistrano::Error, "p4port is incorrect or unset"
72: when /Client \'[\w\-\_\.]+\' unknown.*/i
73: raise Capistrano::Error, "p4client is incorrect or unset"
74: end
75: end
Determines what the response should be for a particular bit of text from the SCM. Password prompts, connection requests, passphrases, etc. are handled here.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 64
64: def handle_data(state, stream, text)
65: case text
66: when /\(P4PASSWD\) invalid or unset\./i
67: raise Capistrano::Error, "scm_password (or p4passwd) is incorrect or unset"
68: when /Can.t create a new user.*/i
69: raise Capistrano::Error, "scm_username (or p4user) is incorrect or unset"
70: when /Perforce client error\:/i
71: raise Capistrano::Error, "p4port is incorrect or unset"
72: when /Client \'[\w\-\_\.]+\' unknown.*/i
73: raise Capistrano::Error, "p4client is incorrect or unset"
74: end
75: end
Returns a "p4 changes" command for the two revisions.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 51
51: def log(from=1, to=head)
52: scm authentication, :changes, "-s submitted", "//#{p4client}/...#{rev_no(from)},#(rev_no(to)}"
53: end
Returns a "p4 changes" command for the two revisions.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 51
51: def log(from=1, to=head)
52: scm authentication, :changes, "-s submitted", "//#{p4client}/...#{rev_no(from)},#(rev_no(to)}"
53: end
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 55
55: def query_revision(revision)
56: return revision if revision.to_s =~ /^\d+$/
57: command = scm(authentication, :changes, "-s submitted", "-m 1", "//#{p4client}/...#{rev_no(revision)}")
58: yield(command)[/Change (\d+) on/, 1]
59: end
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 55
55: def query_revision(revision)
56: return revision if revision.to_s =~ /^\d+$/
57: command = scm(authentication, :changes, "-s submitted", "-m 1", "//#{p4client}/...#{rev_no(revision)}")
58: yield(command)[/Change (\d+) on/, 1]
59: 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.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 34
34: def sync(revision, destination)
35: p4_sync(revision, destination, p4sync_flags)
36: 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.
# File lib/capistrano/recipes/deploy/scm/perforce.rb, line 34
34: def sync(revision, destination)
35: p4_sync(revision, destination, p4sync_flags)
36: end