scvcs 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +38 -8
- data/bin/commands/status.rb +33 -17
- data/lib/scv/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9dca6d85f495e3e2caaf4e9601b99c842a9694f
|
4
|
+
data.tar.gz: aee84f0d4319ba5e2879a762578fc61f04c5c26a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d7a9010feac00b2454fb97c42e04e08434764fa7bfb776014e296c383b55ea92bd54632fa545098d4e9e078f4ce9dbbd3ddde31ebcf42792aa60ede129df464
|
7
|
+
data.tar.gz: d1a016f82d25d0ff3aede9f674e356b9d1345f3d6e46341f20f1e5edb13306bcf1b37300a4d708fcf1ed79a431a68ed1f57edcda71e1801d2397b0a958a7f676
|
data/README.md
CHANGED
@@ -20,9 +20,6 @@ The project itself is split into two parts: [**VCSToolkit**](https://github.com/
|
|
20
20
|
|
21
21
|
Features
|
22
22
|
========
|
23
|
-
*Note: The examples below use the form `scv <command>`, but if you want to test it right now, follow the 3 steps in the **Try it!** section and use `./run_scv <command>`.*
|
24
|
-
|
25
|
-
Currently implemented features:
|
26
23
|
|
27
24
|
---
|
28
25
|
`scv init`
|
@@ -106,14 +103,47 @@ Shows the current value of `<key>`. A key of the form `one.two.three` can be use
|
|
106
103
|
|
107
104
|
Sets the option `key` to `value`. As in the previous command, you can use the `one.two.three` form to reference nested properties. If the key doesn't exist it is created.
|
108
105
|
|
106
|
+
---
|
107
|
+
`scv server`
|
108
|
+
|
109
|
+
Starts an HTTP server to serve as a remote. The server listens on 0.0.0.0 (all addresses) on port 4242.
|
110
|
+
So the remote's address is (for example) `http://localhost:4242`.
|
111
|
+
|
112
|
+
---
|
113
|
+
`scv remote add <name> <address>`
|
114
|
+
|
115
|
+
Adds a remote repository. `<address>` is the HTTP url to a server started with `scv server`
|
116
|
+
|
117
|
+
---
|
118
|
+
`scv remote delete <name>`
|
119
|
+
|
120
|
+
Removes a remote.
|
121
|
+
|
122
|
+
---
|
123
|
+
`scv remote fetch <name> <remote branch> [<local branch>]`
|
124
|
+
|
125
|
+
Fetches remote history. Does not merge automatically and fails if it cannot do a Fast-Forward.
|
126
|
+
|
127
|
+
---
|
128
|
+
`scv remote pull <name> <remote branch> [<local branch>]`
|
129
|
+
|
130
|
+
Fetches the remote history to a local branch with a name of `<remote_name>~<remote_branch>` (for example `origin~master`) and after that merges that branch to `<local branch>`.
|
131
|
+
|
132
|
+
The changes of the merge are not committed.
|
133
|
+
|
134
|
+
---
|
135
|
+
`scv remote push <name> <local branch> [<remote branch>]`
|
136
|
+
|
137
|
+
Pushes local history to remote and updates the remote branch to point to the newest commit.
|
138
|
+
Fails if it cannot do a Fast-Forward.
|
139
|
+
|
109
140
|
|
110
141
|
Try it!
|
111
142
|
=======
|
112
|
-
|
143
|
+
SCV is on RubyGems by the name `scvcs`, because, unfortunately, `scv` was already taken.
|
113
144
|
|
114
|
-
|
115
|
-
|
116
|
-
3. `./run_scv help`
|
145
|
+
`gem install scvcs`
|
146
|
+
`scv help`
|
117
147
|
|
118
148
|
.scv structure
|
119
149
|
================
|
@@ -149,4 +179,4 @@ Contributions are most welcome, but I doubt there will be any :)
|
|
149
179
|
|
150
180
|
If you are interested in learning more about this you can ask me on Twitter [@stormbreakerbg](https://twitter.com/stormbreakerbg).
|
151
181
|
|
152
|
-
![SCV](http://static3.wikia.nocookie.net/__cb20080906211455/starcraft/images/2/24/SCV_SC2_Cncpt1.jpg)
|
182
|
+
![SCV](http://static3.wikia.nocookie.net/__cb20080906211455/starcraft/images/2/24/SCV_SC2_Cncpt1.jpg)
|
data/bin/commands/status.rb
CHANGED
@@ -1,32 +1,48 @@
|
|
1
1
|
desc 'Shows the created, modified and deleted files'
|
2
|
-
arg_name ''
|
2
|
+
arg_name '[<commit>]'
|
3
3
|
command :status do |c|
|
4
4
|
c.action do |global_options, options, args|
|
5
5
|
repository = global_options[:repository]
|
6
|
-
commit_id = repository.branch_head
|
7
|
-
commit = commit_id ? repository[commit_id] : nil
|
8
|
-
status = repository.status commit,
|
9
|
-
ignore: [/^\.|\/\./]
|
10
6
|
|
11
|
-
|
12
|
-
|
7
|
+
|
8
|
+
if args.empty?
|
9
|
+
commit_id = repository.branch_head
|
10
|
+
commit = commit_id ? repository[commit_id] : nil
|
11
|
+
status = repository.status commit,
|
12
|
+
ignore: [/^\.|\/\./]
|
13
|
+
commit_status = false
|
13
14
|
else
|
14
|
-
|
15
|
-
|
15
|
+
source_commit_id = repository[args[0], :commit].parents[0]
|
16
|
+
source_commit = source_commit_id ? repository[source_commit_id] : nil
|
17
|
+
destination_commit = repository[:head, :commit]
|
18
|
+
|
19
|
+
status = repository.commit_status source_commit,
|
20
|
+
destination_commit,
|
21
|
+
ignore: [/^\.|\/\./]
|
22
|
+
commit_status = true
|
16
23
|
end
|
17
24
|
|
18
|
-
|
19
|
-
|
25
|
+
unless commit_status
|
26
|
+
if repository.head.nil?
|
27
|
+
puts "# No commits"
|
28
|
+
else
|
29
|
+
puts "# On branch #{repository.head}"
|
30
|
+
puts "# On commit #{commit.id.yellow}" if commit
|
31
|
+
end
|
20
32
|
|
21
|
-
|
22
|
-
|
33
|
+
if repository.config['merge'] and repository.config['merge']['parents']
|
34
|
+
parents = repository.config['merge']['parents']
|
23
35
|
|
24
|
-
|
25
|
-
puts "#
|
36
|
+
puts
|
37
|
+
puts "# Next commit parents:"
|
38
|
+
|
39
|
+
parents.each do |commit_id|
|
40
|
+
puts "# - #{commit_id.yellow}"
|
41
|
+
end
|
26
42
|
end
|
27
|
-
end
|
28
43
|
|
29
|
-
|
44
|
+
puts
|
45
|
+
end
|
30
46
|
|
31
47
|
if status.none? { |_, files| files.any? }
|
32
48
|
puts "# No changes"
|
data/lib/scv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scvcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Georgy Angelov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vcs_toolkit
|