git-topic 0.2.6.1 → 0.2.7

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.
data/Gemfile.lock CHANGED
@@ -10,7 +10,7 @@ GEM
10
10
  gemcutter (0.5.0)
11
11
  json_pure
12
12
  git (1.2.5)
13
- git-topic (0.2.6.1)
13
+ git-topic (0.2.7)
14
14
  activesupport (~> 3.0)
15
15
  git-topic
16
16
  trollop
data/History.rdoc CHANGED
@@ -1,3 +1,10 @@
1
+ === 0.2.7
2
+
3
+ * issues closed
4
+ - 28 git comments <my-review-branch> would fail to show any comments.
5
+ - 25 git work-on <rejected-topic> would fail if done from a HEAD downstream
6
+ of origin/master, e.g. a different topic.
7
+
1
8
  === 0.2.6
2
9
 
3
10
  * issues closed
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 2
4
- :patch: 6
5
- :build: "1"
4
+ :patch: 7
5
+ :build:
@@ -187,7 +187,6 @@ module GitTopic::Naming
187
187
  namespace_ut[:review] ||= {}
188
188
  namespace_ut[:rejected] ||= {}
189
189
 
190
- namespace_ut[:review].reject!{|k,v| k == user}
191
190
  namespace_ut
192
191
  )
193
192
  end
data/lib/git_topic.rb CHANGED
@@ -61,7 +61,7 @@ module GitTopic
61
61
  if remote_branches.include? "origin/#{b}"
62
62
  git [
63
63
  "reset --hard origin/#{b}",
64
- "push origin :refs/heads/#{b} HEAD:refs/heads/#{wb}",
64
+ "push origin :refs/heads/#{b} +HEAD:refs/heads/#{wb}",
65
65
  ]
66
66
  end
67
67
  end
@@ -162,7 +162,8 @@ module GitTopic
162
162
 
163
163
  sb = ''
164
164
  rb = remote_branches_organized
165
- review_ut = rb[:review]
165
+ # Only others' branche should appear as ‘topics you can review
166
+ review_ut = rb[:review].select{ |u, t| u != user }
166
167
  rejected_ut = rb[:rejected]
167
168
 
168
169
  unless review_ut.empty?
@@ -33,6 +33,19 @@ describe GitTopic do
33
33
  GitTopic.comments "rejected/#{@user}/krakens"
34
34
  end
35
35
 
36
+ it "should list comments for a user's review branches, if requested" do
37
+ GitTopic.work_on 'krakens'
38
+ GitTopic.done
39
+ git_remote_branches.should include "review/#{@user}/krakens"
40
+ GitTopic.should_receive( :git ) do |cmd|
41
+ cmd.should =~ /log/
42
+ cmd.should =~ %r{origin/master\.\.}
43
+ cmd.should =~ /--no-standard-notes/
44
+ cmd.should =~ %r{--show-notes=refs/notes/reviews/#{@user}/krakens}
45
+ end
46
+ GitTopic.comments "krakens"
47
+ end
48
+
36
49
  it "should strip partially qualified namespaces" do
37
50
  git_branch.should == 'master'
38
51
  GitTopic.should_receive( :git ) do |cmd|
@@ -142,6 +142,22 @@ describe GitTopic do
142
142
  ).should == '44ffd9c9c8b52b201659e3ad318cdad6ec836b46'
143
143
  end
144
144
 
145
+ it "should work when HEAD points to a commit downstream of master" do
146
+ GitTopic.work_on 'new-topic'
147
+ dirty_branch!
148
+ system "git add . && git commit -q -a -m 'Non-FF' "
149
+
150
+ git_remote_branches.should include( "rejected/#{@user}/krakens" )
151
+ GitTopic.work_on 'krakens'
152
+ git_branch.should == "wip/#{@user}/krakens"
153
+ git_remote_branches.should_not include( "rejected/#{@user}/krakens" )
154
+ git_remote_branches.should include( "wip/#{@user}/krakens" )
155
+ git_head.should == '44ffd9c9c8b52b201659e3ad318cdad6ec836b46'
156
+ git_remote(
157
+ "wip/#{@user}/krakens"
158
+ ).should == '44ffd9c9c8b52b201659e3ad318cdad6ec836b46'
159
+ end
160
+
145
161
  it "
146
162
  should report the presence of comments to the user, when the topic has
147
163
  been rejected.
data/spec/spec_helper.rb CHANGED
@@ -163,7 +163,9 @@ def git_head suffix=nil
163
163
  end
164
164
 
165
165
  def git_remote branch
166
- `git rev-parse #{branch}`.chomp
166
+ ref = branch
167
+ ref = "origin/#{ref}" unless ref =~ %r{^origin}
168
+ `git rev-parse #{ref}`.chomp
167
169
  end
168
170
 
169
171
  def git_origin_master
@@ -3,5 +3,3 @@
3
3
  filemode = true
4
4
  bare = true
5
5
  sharedrepository = 1
6
- [receive]
7
- denyNonFastforwards = true
metadata CHANGED
@@ -5,9 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 6
9
- - 1
10
- version: 0.2.6.1
8
+ - 7
9
+ version: 0.2.7
11
10
  platform: ruby
12
11
  authors:
13
12
  - David J. Hamilton
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-10-20 00:00:00 -07:00
17
+ date: 2010-10-21 00:00:00 -07:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency