summaryrefslogtreecommitdiff
path: root/morphlib/gitdir.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/gitdir.py')
-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: