hglib 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1831178444a5bbe2fb453d239599e26d4782165b7b2af7f6e71a28b64276522
4
- data.tar.gz: 0f96a27244db04c9de5fef85b3eddec913bc39eb44baf78b380e03740612ac45
3
+ metadata.gz: 1b44a7bfe2cfb5f6a8ef10442f151fe85ab0299622d2d0531da868a56da9c3be
4
+ data.tar.gz: 297997d18c6ae2052127b14a5edd0b7caeac0b36511c14f72f53cf03439159c1
5
5
  SHA512:
6
- metadata.gz: e4fb661745d09d420ab79e326c781370f94fc0914f3f8b9da567b82c81653383bce5ec86d7cc02d8ad03cbd2b6a340da13d5d757fd3c70d584074b8c85d04bca
7
- data.tar.gz: 30a4dedce283f503fe5a882ead7a9bb9c65e91c9f84481a939c22eefecde20b39efcf744f1fe313f586608c3388b3e37539cb65a94461a06c4f3b0fa35a1a2b4
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
@@ -2,6 +2,13 @@
2
2
 
3
3
  ---
4
4
 
5
+ ## v0.9.0 [2020-03-04] Michael Granger <ged@FaerieMUD.org>
6
+
7
+ Improvements:
8
+
9
+ - Add Repo#remove, #rename, and #forget.
10
+
11
+
5
12
  ## v0.8.1 [2020-02-19] Michael Granger <ged@FaerieMUD.org>
6
13
 
7
14
  Improvements:
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://https://hg.sr.ht/~ged/hglib' )
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
@@ -11,7 +11,7 @@ module Hglib
11
11
 
12
12
 
13
13
  # Package version
14
- VERSION = '0.8.1'
14
+ VERSION = '0.9.0'
15
15
 
16
16
  # Version control revision
17
17
  REVISION = %q$Revision$
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
@@ -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.8.1
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-02-19 00:00:00.000000000 Z
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
- This is a client library for the Mercurial distributed revision control tool
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 {Command Server}[https://www.mercurial-scm.org/wiki/CommandServer]
171
- for efficiency.
174
+ that uses the Command Server
172
175
  test_files: []
metadata.gz.sig CHANGED
Binary file