svp 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -0
- data/lib/svp/cli.rb +19 -1
- data/lib/svp/p4.rb +2 -6
- data/lib/svp/version.rb +1 -1
- data/lib/svp/workspace.rb +5 -1
- metadata +1 -1
data/CHANGELOG
CHANGED
data/lib/svp/cli.rb
CHANGED
@@ -6,12 +6,30 @@ require 'svp/workspace'
|
|
6
6
|
|
7
7
|
module Svp
|
8
8
|
module CLI
|
9
|
+
ABBREVIATIONS = {
|
10
|
+
"ci" => "commit",
|
11
|
+
"co" => "checkout",
|
12
|
+
"cp" => "copy",
|
13
|
+
"del" => "delete",
|
14
|
+
"remove" => "delete",
|
15
|
+
"rm" => "delete",
|
16
|
+
"di" => "diff",
|
17
|
+
"st" => "status",
|
18
|
+
"stat" => "status",
|
19
|
+
"up" => "update",
|
20
|
+
"mv" => "move",
|
21
|
+
"ren" => "move",
|
22
|
+
"rename" => "rename"
|
23
|
+
}
|
24
|
+
|
9
25
|
def self.execute!
|
10
26
|
work_dir = ENV["PWD"]
|
11
27
|
command = ARGV.first
|
12
28
|
args = ARGV[1..-1]
|
13
29
|
config = nil
|
14
|
-
|
30
|
+
|
31
|
+
command = ABBREVIATIONS[command] || command
|
32
|
+
|
15
33
|
if command == "version"
|
16
34
|
puts "svp, version #{VERSION::STRING}"
|
17
35
|
puts "Copyright (c) 2006 RedHill Consulting, Pty. Ltd. All rights reserved."
|
data/lib/svp/p4.rb
CHANGED
@@ -13,7 +13,8 @@ module Svp
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def initialize(depot_uri, local_dir)
|
16
|
-
@depot_uri
|
16
|
+
@depot_uri = depot_uri
|
17
|
+
@local_dir = local_dir
|
17
18
|
@client_name = "tmp_#{Socket.gethostname}"
|
18
19
|
end
|
19
20
|
|
@@ -47,15 +48,10 @@ EOS
|
|
47
48
|
@success = false
|
48
49
|
begin
|
49
50
|
if input
|
50
|
-
print command
|
51
|
-
print "<"
|
52
|
-
print input
|
53
51
|
output = IO.popen(command_line(command), 'r+') { |io| io.puts input; io.close_write; io.read }
|
54
52
|
else
|
55
|
-
puts command
|
56
53
|
output = IO.popen(command_line(command)) { |io| io.read }
|
57
54
|
end
|
58
|
-
print output
|
59
55
|
output
|
60
56
|
ensure
|
61
57
|
@success = $?.success?
|
data/lib/svp/version.rb
CHANGED
data/lib/svp/workspace.rb
CHANGED
@@ -24,6 +24,7 @@ module Svp
|
|
24
24
|
changes = changes(paths)
|
25
25
|
remote_exec do |p4|
|
26
26
|
changes.each { |change| change.prepare_to_commit(p4) }
|
27
|
+
puts "Transmitting file data ..."
|
27
28
|
if p4.submit =~ /^Change (\d+) submitted./
|
28
29
|
@revision = $1.to_i
|
29
30
|
changes.each { |change| change.commit }
|
@@ -67,7 +68,10 @@ module Svp
|
|
67
68
|
end
|
68
69
|
|
69
70
|
def update(*remove_me)
|
70
|
-
|
71
|
+
if !changes.empty?
|
72
|
+
puts "Local changes may cause conflicts"
|
73
|
+
return
|
74
|
+
end
|
71
75
|
|
72
76
|
remote_exec do |p4|
|
73
77
|
p4.changes("-m 1").scan(/^Change (\d+) on/) do |revision|
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: svp
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
6
|
+
version: 0.1.2
|
7
7
|
date: 2006-10-18 00:00:00 +10:00
|
8
8
|
summary: SVN facade for Perforce. Supports offline diff, status, revert. Doesn't require a permanent client configuration.
|
9
9
|
require_paths:
|