hglib 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.md +7 -0
- data/README.md +1 -1
- data/lib/hglib.rb +1 -1
- data/lib/hglib/repo.rb +41 -0
- data/spec/hglib/repo_spec.rb +40 -0
- metadata +11 -8
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b44a7bfe2cfb5f6a8ef10442f151fe85ab0299622d2d0531da868a56da9c3be
|
4
|
+
data.tar.gz: 297997d18c6ae2052127b14a5edd0b7caeac0b36511c14f72f53cf03439159c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a1064d476c0da406d388fbf258f401a61f827f3474dec57957f403dbf16e687b3aab560734140e85a0507a4846d5985363ea44260f203af70ffa5d951763c0e
|
7
|
+
data.tar.gz: ebc36258eacf58603c98eae67bce359f0c633dfc48442aff0c76078db074ba10a7ffe5d393109439ca4723b029b73dbbe7aea349372ad6db5f6a81b9c28c549f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -24,7 +24,7 @@ that uses the [Command Server][cmdserver] for efficiency.
|
|
24
24
|
|
25
25
|
require 'hglib'
|
26
26
|
|
27
|
-
repo = Hglib.clone( 'https://
|
27
|
+
repo = Hglib.clone( 'https://hg.sr.ht/~ged/hglib' )
|
28
28
|
# => #<Hglib::Repo:0x00007fae3880ec90 @path=#<Pathname:/Users/ged/temp/hglib>, @server=nil>
|
29
29
|
|
30
30
|
|
data/lib/hglib.rb
CHANGED
data/lib/hglib/repo.rb
CHANGED
@@ -102,6 +102,47 @@ class Hglib::Repo
|
|
102
102
|
end
|
103
103
|
|
104
104
|
|
105
|
+
### Schedule the given +files+ to be removed from the current branch.
|
106
|
+
def remove( *files, **options )
|
107
|
+
self.server.run( :remove, *files, **options )
|
108
|
+
return true
|
109
|
+
end
|
110
|
+
alias_method :rm, :remove
|
111
|
+
|
112
|
+
|
113
|
+
### Rename files; equivalent of copy + remove
|
114
|
+
###
|
115
|
+
### Mark +dest+ as copies of +sources+; mark +sources+ (which can be a single
|
116
|
+
### path or an Array of paths) for deletion. If +dest+ is a directory, copies
|
117
|
+
### are put in that directory. If +dest+ is a file, there can only be one
|
118
|
+
### +source+.
|
119
|
+
###
|
120
|
+
### By default, this command copies the contents of files as they exist in the
|
121
|
+
### working directory. If invoked with the :after option, the operation is recorded,
|
122
|
+
### but no copying is performed.
|
123
|
+
###
|
124
|
+
### This command takes effect at the next commit. To undo a rename before
|
125
|
+
### that, see 'hg revert'.
|
126
|
+
def rename( sources, dest, **options )
|
127
|
+
files = Array( sources ) + [ dest ]
|
128
|
+
self.server.run( :rename, *files, **options )
|
129
|
+
return true
|
130
|
+
end
|
131
|
+
alias_method :move, :rename
|
132
|
+
alias_method :mv, :rename
|
133
|
+
|
134
|
+
|
135
|
+
### Mark the specified +files+ so they will no longer be tracked after the next
|
136
|
+
### commit.
|
137
|
+
###
|
138
|
+
### This only removes +files+ from the current branch, not from the entire
|
139
|
+
### project history, and it does not delete them from the working directory.
|
140
|
+
def forget( *files, **options )
|
141
|
+
self.server.run( :forget, *files, **options )
|
142
|
+
return true
|
143
|
+
end
|
144
|
+
|
145
|
+
|
105
146
|
### Add all new files and remove all missing files from the repository.
|
106
147
|
###
|
107
148
|
### Unless +files+ are given, new files are ignored if they match any of the
|
data/spec/hglib/repo_spec.rb
CHANGED
@@ -204,6 +204,46 @@ RSpec.describe Hglib::Repo do
|
|
204
204
|
end
|
205
205
|
|
206
206
|
|
207
|
+
it "can remove tracked files from the repository" do
|
208
|
+
repo = described_class.new( repo_dir )
|
209
|
+
|
210
|
+
expect( server ).to receive( :run ).with( :remove, "stripe.apikey" )
|
211
|
+
|
212
|
+
result = repo.rm( 'stripe.apikey' )
|
213
|
+
expect( result ).to be_truthy
|
214
|
+
end
|
215
|
+
|
216
|
+
|
217
|
+
it "can mark files so they will no longer be tracked after the next commit" do
|
218
|
+
repo = described_class.new( repo_dir )
|
219
|
+
|
220
|
+
expect( server ).to receive( :run ).with( :forget, "ChangeLog" )
|
221
|
+
|
222
|
+
result = repo.forget( 'ChangeLog' )
|
223
|
+
expect( result ).to be_truthy
|
224
|
+
end
|
225
|
+
|
226
|
+
|
227
|
+
it "can rename files in the repository" do
|
228
|
+
repo = described_class.new( repo_dir )
|
229
|
+
|
230
|
+
expect( server ).to receive( :run ).with( :rename, "README.rdoc", "README.md" )
|
231
|
+
|
232
|
+
result = repo.mv( 'README.rdoc', 'README.md' )
|
233
|
+
expect( result ).to be_truthy
|
234
|
+
end
|
235
|
+
|
236
|
+
|
237
|
+
it "can record all adds/moves/removes in a directory" do
|
238
|
+
repo = described_class.new( repo_dir )
|
239
|
+
|
240
|
+
expect( server ).to receive( :run ).with( :addremove, any_args )
|
241
|
+
|
242
|
+
result = repo.addremove
|
243
|
+
expect( result ).to be_truthy
|
244
|
+
end
|
245
|
+
|
246
|
+
|
207
247
|
it "can return the current Mercurial configuration" do
|
208
248
|
repo = described_class.new( repo_dir )
|
209
249
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hglib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
jBZSA+N+xUTgUWpXjjwsLZjzJkhWATJWq+krNXcqpwXo6HsjmdUxoFMt63RBb+sI
|
35
35
|
XrxOxp8o0uOkU7FdLSGsyqJ2LzsR4obN
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2020-
|
37
|
+
date: 2020-03-04 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: loggability
|
@@ -106,9 +106,8 @@ dependencies:
|
|
106
106
|
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0.4'
|
109
|
-
description:
|
110
|
-
|
111
|
-
that uses the {Command Server}[https://www.mercurial-scm.org/wiki/CommandServer] for efficiency.
|
109
|
+
description: This is a client library for the Mercurial distributed revision control
|
110
|
+
tool that uses the Command Server …
|
112
111
|
email:
|
113
112
|
- ged@FaerieMUD.org
|
114
113
|
executables: []
|
@@ -147,7 +146,12 @@ files:
|
|
147
146
|
homepage: https://hg.sr.ht/~ged/hglib
|
148
147
|
licenses:
|
149
148
|
- BSD-3-Clause
|
150
|
-
metadata:
|
149
|
+
metadata:
|
150
|
+
homepage_uri: https://hg.sr.ht/~ged/hglib
|
151
|
+
documentation_uri: http://deveiate.org/code/hglib
|
152
|
+
changelog_uri: http://deveiate.org/code/hglib/History_md.html
|
153
|
+
source_uri: https://hg.sr.ht/~ged/hglib
|
154
|
+
bug_tracker_uri: https://todo.sr.ht/~ged/hglib
|
151
155
|
post_install_message:
|
152
156
|
rdoc_options: []
|
153
157
|
require_paths:
|
@@ -167,6 +171,5 @@ rubygems_version: 3.1.2
|
|
167
171
|
signing_key:
|
168
172
|
specification_version: 4
|
169
173
|
summary: This is a client library for the Mercurial distributed revision control tool
|
170
|
-
that uses the
|
171
|
-
for efficiency.
|
174
|
+
that uses the Command Server …
|
172
175
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|