gitcycle 0.1.13 → 0.1.14

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/README.md CHANGED
@@ -19,6 +19,19 @@ Type `gitc` + your ticket URL to create a new branch:
19
19
 
20
20
  gitc https://xxx.lighthouseapp.com/projects/0000/tickets/0000-my-ticket
21
21
 
22
+ Reset Branch
23
+ ------------
24
+
25
+ If you associate the wrong branch with a ticket, use `git reset` to fix it.
26
+
27
+ Checkout the branch that you will eventually merge your feature into:
28
+
29
+ git checkout master
30
+
31
+ Type `gitc reset` + your ticket URL to reset the branch:
32
+
33
+ gitc reset https://xxx.lighthouseapp.com/projects/0000/tickets/0000-my-ticket
34
+
22
35
  Pull Changes from Upstream
23
36
  --------------------------
24
37
 
@@ -101,4 +114,5 @@ Todo
101
114
 
102
115
  * Instead of detecting CONFLICT, use error status $? != 0
103
116
  * Add comment on lighthouse with issue URL
104
- * Label issues with ticket milestone?
117
+ * Label issues with ticket milestone?
118
+ * gitc qa pass, should not set ticket to pending-approval if its already resolved
@@ -62,6 +62,27 @@ Scenario: Feature branch
62
62
  """
63
63
  And redis entries valid
64
64
 
65
+ Scenario: Reset feature branch
66
+ Given a fresh set of repositories
67
+ When I cd to the user repo
68
+ And I execute gitcycle reset with the Lighthouse ticket URL
69
+ And I enter "y"
70
+ And I enter "y"
71
+ Then gitcycle runs
72
+ And output includes
73
+ """
74
+ Retrieving branch information from gitcycle.
75
+ Your work will eventually merge into 'master'. Is this correct? (y/n)
76
+ Would you like to name your branch 'ticket.id'? (y/n)
77
+ Adding remote repo 'config.owner/config.repo'.
78
+ Fetching remote repo 'config.owner/config.repo'.
79
+ Checking out remote branch 'ticket.id' from 'config.owner/config.repo/master'.
80
+ Pulling 'origin/ticket.id'.
81
+ Pushing 'origin/ticket.id'.
82
+ Sending branch information to gitcycle.
83
+ """
84
+ And redis entries valid
85
+
65
86
  Scenario: Checkout via ticket w/ existing branch
66
87
  When I cd to the user repo
67
88
  And I execute gitcycle with the Lighthouse ticket URL
@@ -143,6 +143,10 @@ When /^I execute gitcycle with the Lighthouse ticket URL$/ do
143
143
  $execute << $ticket.url
144
144
  end
145
145
 
146
+ When /^I execute gitcycle reset with the Lighthouse ticket URL$/ do
147
+ $execute << "reset #{$ticket.url}"
148
+ end
149
+
146
150
  When /^I cd to the (.*) repo$/ do |user|
147
151
  if ENV['REPO']
148
152
  puts "(overiding repo as #{ENV['REPO']})"
data/gitcycle.gemspec CHANGED
@@ -6,7 +6,7 @@ $:.unshift lib unless $:.include?(lib)
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "gitcycle"
9
- s.version = '0.1.13'
9
+ s.version = '0.1.14'
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = [ 'Winton Welsh' ]
12
12
  s.email = [ 'mail@wintoni.us' ]
data/lib/gitcycle.rb CHANGED
@@ -35,7 +35,7 @@ class Gitcycle
35
35
  start(args) if args
36
36
  end
37
37
 
38
- def create_branch(url_or_title)
38
+ def create_branch(url_or_title, reset=false)
39
39
  require_git && require_config
40
40
 
41
41
  params = {}
@@ -53,6 +53,8 @@ class Gitcycle
53
53
  }
54
54
  end
55
55
 
56
+ params['reset'] = '1' if reset
57
+
56
58
  puts "\nRetrieving branch information from gitcycle.\n".green
57
59
  branch = get('branch', params)
58
60
 
@@ -283,6 +285,10 @@ class Gitcycle
283
285
  end
284
286
  end
285
287
 
288
+ def reset(ticket_or_url)
289
+ create_branch(ticket_or_url, true)
290
+ end
291
+
286
292
  def reviewed(*issues)
287
293
  require_git && require_config
288
294
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitcycle
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 13
10
- version: 0.1.13
9
+ - 14
10
+ version: 0.1.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - Winton Welsh