summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-04-09 06:34:08 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-04-09 06:34:08 +0000
commit8518071959d0ccc1f2cdc76925e83a28c1179818 (patch)
tree501cba957cb2046fd798a6f0ae7c359c1b2c0350
parentc04760ffe1d385134e5092a22db5e5f78c205038 (diff)
parent967753ece20087297cacf26f5e08bf555a2e6868 (diff)
downloadmorph-8518071959d0ccc1f2cdc76925e83a28c1179818.tar.gz
Merge branch 'sam/tweak-no-origin-error'
Reviewed-By: Lars Wirzenius <lars.wirzenius@codethink.co.uk>
-rw-r--r--morphlib/gitdir.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/morphlib/gitdir.py b/morphlib/gitdir.py
index 3d0ab53e..8f6d69d7 100644
--- a/morphlib/gitdir.py
+++ b/morphlib/gitdir.py
@@ -108,23 +108,22 @@ class PushError(cliapp.AppException):
class NoRefspecsError(PushError):
def __init__(self, remote):
- self.remote = remote.name
- PushError.__init__(self,
- 'Push to remote %r was given no refspecs.' % remote)
+ self.remote = remote
+ PushError.__init__(
+ self, 'Push to remote "%s" was given no refspecs.' % remote)
class PushFailureError(PushError):
def __init__(self, remote, refspecs, exit, results, stderr):
- self.remote = remote.name
+ self.remote = remote
self.push_url = push_url = remote.get_push_url()
self.refspecs = refspecs
self.exit = exit
self.results = results
self.stderr = stderr
- PushError.__init__(self, 'Push to remote %(remote)r, '\
+ PushError.__init__(self, 'Push to remote "%(remote)s", '\
'push url %(push_url)s '\
- 'with refspecs %(refspecs)r '\
'failed with exit code %(exit)s' % locals())
@@ -235,6 +234,9 @@ class Remote(object):
self.push_url = None
self.fetch_url = None
+ def __str__(self):
+ return self.name or '(nascent remote)'
+
def set_fetch_url(self, url):
self.fetch_url = url
if self.name is not None: