TicGit-ng 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.mkd CHANGED
@@ -67,24 +67,14 @@ And those notices should go away.
67
67
 
68
68
 
69
69
 
70
- ### Installing ###
71
- Installation on a Debian stable system. Note that the command line interface for TicGit-ng can be run from Debian stable, but some of the gems required for the web interface may require you to use [apt](http://jaqque.sbih.org/kplug/apt-pinning.html) [pinning](http://jeffwelling.github.com//2010/09/05/Apt-Pinning.html) to run without errors. See below.
72
-
73
- If you know what rake is and know you already have it installed, you can use the command `rake setup` to automatically install all dependencies, but the suggested method is to manually install as outlined below.
74
-
75
- There are two parts to ticgit, the command line interface `ti` and the optional web based interface `ticgitweb`. To install the dependencies for either one, do
76
-
77
- *ti*
78
- sudo aptitude install rubygems
79
- sudo gem install git
80
-
81
- *ticgitweb*
82
-
83
- sudo aptitude install rubygems
84
- sudo gem install ticgit sinatra haml sass
70
+ ### Installing ##
71
+ Installation on a Debian stable system. Note that the command line interface for TicGit-ng can be run from Debian stable, but some of the gems required for the web interface may require you to use [apt](http://jaqque.sbih.org/kplug/apt-pinning.html) [pinning](http://jeffwelling.github.com//2010/09/05/Apt-Pinning.html) to run without errors. See below
85
72
 
73
+ To install TicGit-ng on your system, you can go one of two ways,
86
74
 
75
+ $ gem install TicGit-ng
87
76
 
77
+ or, you can install it from source by downloading this repository building your own gem (see below).
88
78
 
89
79
  ### Usage ###
90
80
 
@@ -405,8 +395,6 @@ This will create a pkg/ directory, which will contain a newly created ticgit-ng
405
395
 
406
396
  More information on developing TicGit-ng and collaborating with other TicGit-ng developers at [here](https://github.com/jeffWelling/ticgit/wiki/Development)
407
397
 
408
- More information on developing TicGit-ng and collaborating with other TicGit-ng developers at [here](https://github.com/jeffWelling/ticgit/wiki/Development)
409
-
410
398
  ### Alternatives ###
411
399
 
412
400
  ditz
@@ -3,7 +3,7 @@ module TicGitNG
3
3
  class Base
4
4
 
5
5
  attr_reader :git, :logger
6
- attr_reader :tic_working, :tic_index
6
+ attr_reader :tic_working, :tic_index, :tic_dir
7
7
  attr_reader :last_tickets, :current_ticket # saved in state
8
8
  attr_reader :config
9
9
  attr_reader :state, :config_file
@@ -15,7 +15,7 @@ module TicGitNG
15
15
 
16
16
  proj = Ticket.clean_string(@git.dir.path)
17
17
 
18
- @tic_dir = opts[:tic_dir] || '~/.ticgit-ng'
18
+ @tic_dir = opts[:tic_dir] || "~/.#{which_branch?}"
19
19
  @tic_working = opts[:working_directory] || File.expand_path(File.join(@tic_dir, proj, 'working'))
20
20
  @tic_index = opts[:index_file] || File.expand_path(File.join(@tic_dir, proj, 'index'))
21
21
 
@@ -196,9 +196,9 @@ module TicGitNG
196
196
  def ticket_recent(ticket_id = nil)
197
197
  if ticket_id
198
198
  t = ticket_revparse(ticket_id)
199
- return git.log.object('ticgit-ng').path(t)
199
+ return git.log.object(which_branch?).path(t)
200
200
  else
201
- return git.log.object('ticgit-ng')
201
+ return git.log.object(which_branch?)
202
202
  end
203
203
  end
204
204
 
@@ -278,10 +278,17 @@ module TicGitNG
278
278
  end
279
279
 
280
280
  def sync_tickets(repo='origin', push=true, verbose=true )
281
+ puts "Fetching #{repo}" if verbose
282
+ @git.fetch(repo)
283
+ puts "Syncing tickets with #{repo}" if verbose
284
+ remote_branches=@git.branches.remote.map{|b|
285
+ b.full.gsub('remotes/', '')[Regexp.new("^#{Regexp.escape(repo)}/.*")]
286
+ }.compact
287
+ !remote_branches.include?('ticgit-ng') ? r_ticgit='ticgit-ng' : r_ticgit='ticgit'
281
288
  in_branch(false) do
282
289
  repo_g=git.remote(repo)
283
- git.pull(repo_g, repo+'/ticgit-ng')
284
- git.push(repo_g, 'ticgit-ng:ticgit-ng') if push
290
+ git.pull(repo_g, repo+'/'+r_ticgit)
291
+ git.push(repo_g, "#{which_branch?}:"+r_ticgit ) if push
285
292
  puts "Tickets synchronized." if verbose
286
293
  end
287
294
  end
@@ -295,11 +302,12 @@ module TicGitNG
295
302
 
296
303
  bs = git.lib.branches_all.map{|b| b.first }
297
304
 
298
- unless bs.include?('ticgit-ng') && File.directory?(@tic_working)
299
- init_ticgitng_branch(bs.include?('ticgit-ng'))
305
+ unless (bs.include?(which_branch?) || bs.include?(which_branch?)) &&
306
+ File.directory?(@tic_working)
307
+ init_ticgitng_branch(bs.include?(which_branch?))
300
308
  end
301
309
 
302
- tree = git.lib.full_tree('ticgit-ng')
310
+ tree = git.lib.full_tree(which_branch?)
303
311
  tree.each do |t|
304
312
  data, file = t.split("\t")
305
313
  mode, type, sha = data.split(" ")
@@ -345,10 +353,11 @@ module TicGitNG
345
353
 
346
354
  old_current = git.lib.branch_current
347
355
  begin
348
- git.lib.change_head_branch('ticgit-ng')
356
+ git.lib.change_head_branch(which_branch?)
349
357
  git.with_index(@tic_index) do
350
358
  git.with_working(@tic_working) do |wd|
351
- git.lib.checkout('ticgit-ng') if needs_checkout && branch_exists
359
+ git.lib.checkout(which_branch?) if needs_checkout &&
360
+ branch_exists
352
361
  yield wd
353
362
  end
354
363
  end
@@ -360,6 +369,16 @@ module TicGitNG
360
369
  def new_file(name, contents)
361
370
  File.open(name, 'w+'){|f| f.puts(contents) }
362
371
  end
372
+ def which_branch?
373
+ branches=@git.branches.local.map {|b| b.name}
374
+ if branches.include? 'ticgit-ng'
375
+ return 'ticgit-ng'
376
+ else
377
+ return 'ticgit'
378
+ end
379
+ #If has ~/.ticgit dir, and 'ticgit' branch
380
+ #If has ~/.ticgit-ng dir, and 'ticgit-ng' branch, and not ~/.ticgit dir and not 'ticgit' branch
381
+ end
363
382
 
364
383
  end
365
384
  end
@@ -1,3 +1,3 @@
1
1
  module TicGitNG
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: TicGit-ng
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Scott Chacon
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-15 00:00:00 -05:00
19
+ date: 2011-02-28 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency