Skip to content

Commit

Permalink
[close #2] Prevent start from non-integration branch; add milestone i…
Browse files Browse the repository at this point in the history
…nformation to git-issues
  • Loading branch information
jzempel committed Mar 11, 2013
1 parent bf5b783 commit 5aca5de
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
---------

Version 0.4.2
^^^^^^^^^^^^^

* Prevent start from non-integration branch.
* Add milestone to 'issues' command.

Version 0.4.1
^^^^^^^^^^^^^

Expand Down
4 changes: 2 additions & 2 deletions continuity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
Continuity API.
:copyright: 2012 by Jonathan Zempel.
:copyright: 2013 by Jonathan Zempel.
:license: BSD, see LICENSE for more details.
"""

__author__ = "Jonathan Zempel"
__license__ = "BSD"
__version__ = "0.4.1"
__version__ = "0.4.2"
22 changes: 17 additions & 5 deletions continuity/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Continuity command line interface.
:copyright: 2012 by Jonathan Zempel.
:copyright: 2013 by Jonathan Zempel.
:license: BSD, see LICENSE for more details.
"""

Expand Down Expand Up @@ -746,11 +746,17 @@ def issues(arguments):
else:
title = issue.title

if issue.assignee:
login = issue.assignee.login
title = "{0} ({1})".format(title, login)
information = issue.assignee

message = "{0}: {1}\n".format(number, title)
if information and issue.milestone:
information = "{0}, {1}".format(information, issue.milestone)
else:
information = issue.milestone

if information:
title = "{0} ({1})".format(title, information)

message = "{0}: {1}\n".format(number, title.strip())
output.write(message)

pipepager(output.getvalue(), cmd="less -FRSX")
Expand Down Expand Up @@ -839,6 +845,12 @@ def start(arguments):

namespace = ContinuityNamespace(git)
parser.parse_args(arguments.all, namespace=namespace)
integration_branch = _get_value(git, "continuity", "integration-branch")

if git.branch.name != integration_branch:
message = "error: Attempted start from non-integration branch, switch to '{0}'." # NOQA
puts_err(message.format(integration_branch))
exit(128)

if tracker == "github":
token = _get_value(git, "github", "oauth-token")
Expand Down
2 changes: 1 addition & 1 deletion continuity/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Git API.
:copyright: 2012 by Jonathan Zempel.
:copyright: 2013 by Jonathan Zempel.
:license: BSD, see LICENSE for more details.
"""

Expand Down
12 changes: 11 additions & 1 deletion continuity/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
GitHub API.
:copyright: 2012 by Jonathan Zempel.
:copyright: 2013 by Jonathan Zempel.
:license: BSD, see LICENSE for more details.
"""

Expand Down Expand Up @@ -83,6 +83,11 @@ class Issue(IDObject):
STATE_CLOSED = "closed"
STATE_OPEN = "open"

def __str__(self):
"""Issue string representation.
"""
return self.title

@property
def assignee(self):
"""Issue assignee accessor.
Expand Down Expand Up @@ -217,6 +222,11 @@ class Milestone(IDObject):
STATE_CLOSED = "closed"
STATE_OPEN = "open"

def __str__(self):
"""Milestone string representation.
"""
return self.title

@property
def closed_issues(self):
"""Milestone closed issues count.
Expand Down
2 changes: 1 addition & 1 deletion continuity/pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Pivotal Tracker API.
:copyright: 2012 by Jonathan Zempel.
:copyright: 2013 by Jonathan Zempel.
:license: BSD, see LICENSE for more details.
"""

Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Main continuity entry point.
:copyright: 2012 by Jonathan Zempel.
:copyright: 2013 by Jonathan Zempel.
:license: BSD, see LICENSE for more details.
"""

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Setup the continuity distribution.
:copyright: 2012 by Jonathan Zempel.
:copyright: 2013 by Jonathan Zempel.
:license: BSD, see LICENSE for more details.
"""

Expand Down

0 comments on commit 5aca5de

Please sign in to comment.