git-trac 0.1.0 → 0.1.1

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.
@@ -101,7 +101,7 @@ module Git
101
101
  ENV["GIT_AUTHOR_EMAIL"] = ENV["GIT_COMMITTER_EMAIL"] = email
102
102
  ENV["GIT_AUTHOR_DATE"] = ENV["GIT_COMMITTER_DATE"] = timestamp
103
103
  commit = repository.popen3("git commit-tree #{tree} -p #{parent}") do |i,o,e|
104
- i.puts "#{ticket.number}/#{filename}"
104
+ i.puts "trac/#{ticket.number}/#{filename}"
105
105
  i.puts "\n#{description}" if description
106
106
  i.close
107
107
  o.read.chomp
@@ -16,7 +16,7 @@ module Git
16
16
  alias to_s body
17
17
 
18
18
  def git?
19
- body[0,10] == "diff --git" || body[0,6] == "--- a/"
19
+ body[0,1024] =~ /^diff --git / || body[0,6] == "--- a/"
20
20
  end
21
21
 
22
22
  # Rewrite filenames in a patch to be relative to +root+. For each .. at
@@ -25,7 +25,7 @@ module Git
25
25
 
26
26
  def reload #:nodoc:
27
27
  @config = nil
28
- @options = (config("trac")||{}).merge(@options)
28
+ @options = (config("trac")||{}).merge(config("trac-remote.trac")||{}).merge(@options)
29
29
  end
30
30
 
31
31
  def inspect
@@ -207,7 +207,6 @@ module Git
207
207
  if revs.include?(object)
208
208
  exec("git","branch","-D",File.basename(ref))
209
209
  elsif diff_hashes && diff_hashes.include?(dh = diff_hash(ref))
210
- p "wooo!"
211
210
  exec("git","branch","-D",File.basename(ref))
212
211
  end
213
212
  end
@@ -262,8 +261,8 @@ module Git
262
261
  return local.sub(/\*/,$1)
263
262
  end
264
263
  end
265
- svn["branches"].to_s
266
264
  end
265
+ nil
267
266
  end
268
267
 
269
268
  # Fetch a ticket object by number.
@@ -120,7 +120,7 @@ See `git-trac help` for details.
120
120
  def repository
121
121
  @repository ||= Git::Trac::Repository.new(@repository_option)
122
122
  unless @repository.url
123
- abort "no URL. Try `git config trac.url http://trac-url`"
123
+ abort "no URL. Try `git config trac-remote.trac.url http://trac-url`"
124
124
  end
125
125
  @repository
126
126
  end
@@ -134,7 +134,7 @@ See `git-trac help` for details.
134
134
 
135
135
  def system(*args)
136
136
  repository.in_work_tree do
137
- Kernel.system(*args) or exit $?.exitstatus
137
+ Kernel.system(*args) or exit $?.exitstatus || 1
138
138
  end
139
139
  end
140
140
 
@@ -226,7 +226,7 @@ See `git-trac help` for details.
226
226
  system(options[:fetch_command])
227
227
  elsif repository.config("svn-remote.svn")
228
228
  system("git svn fetch")
229
- elsif repository.config("origin")
229
+ elsif repository.config("remote.origin")
230
230
  system("git fetch origin")
231
231
  end
232
232
  end
@@ -71,16 +71,21 @@ Show help for a given topic or command.
71
71
  TOPICS = {}
72
72
 
73
73
  TOPICS["config"] = ["Configuration"] << <<-EOF
74
- The following configuration options control git-trac:
75
- trac.url The root URL to the Trac website
76
- trac.username Username (if required by site)
77
- trac.password Password (if required by site)
74
+ The following configuration options relate to the general operation of
75
+ git-trac:
78
76
  trac.depth Default --depth for commands which accept it
79
77
  trac.fetch-command Update command to use in lieu of git svn fetch
80
78
 
79
+ The following configuration options specify the trac site to scrape. They
80
+ are still also read from the trac section for backwards compatibility, but
81
+ this is deprecated.
82
+ trac-remote.trac.url The root URL to the Trac website
83
+ trac-remote.trac.username Username (if required by site)
84
+ trac-remote.trac.password Password (if required by site)
85
+
81
86
  They may be set either by editing the git config file or with git config.
82
87
  $ vim .git/config
83
- $ git config trac.url http://my.trac.url
88
+ $ git config trac-remote.trac.url http://my.trac.url
84
89
 
85
90
  Additionally, the following options can affect git-trac's behavior:
86
91
  core.pager
@@ -102,9 +107,9 @@ Example for usage on the Ruby on Rails repository:
102
107
  $ git gc
103
108
 
104
109
  # Setup git-trac (see git-trac help config)
105
- $ git config trac.url http://dev.rubyonrails.org
106
- $ git config trac.username myaccount
107
- $ git config trac.password mypassword
110
+ $ git config trac-remote.trac.url http://dev.rubyonrails.org
111
+ $ git config trac-remote.trac.username myaccount
112
+ $ git config trac-remote.trac.password mypassword
108
113
 
109
114
  # Have fun
110
115
  $ git-trac checkout 1234567/new_feature_with_failing_tests.patch
@@ -3,7 +3,7 @@ module Git
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- TINY = 0
6
+ TINY = 1
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join('.')
9
9
  end
@@ -42,7 +42,7 @@ class ExecutionTest < Test::Unit::TestCase
42
42
  @repo.exec("git","config","svn-remote.svn.url","http://dev.rubyonrails.org/svn/rails")
43
43
  @repo.reload
44
44
  assert_equal "http://dev.rubyonrails.org", @repo.url
45
- @repo.exec("git","config","trac.url","http://foo/trac.cgi")
45
+ @repo.exec("git","config","trac-remote.trac.url","http://foo/trac.cgi")
46
46
  @repo.reload
47
47
  assert_equal "http://foo/trac.cgi", @repo.url
48
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-trac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pope
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-11 00:00:00 -06:00
12
+ date: 2008-02-13 00:00:00 -06:00
13
13
  default_executable: git-trac
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency