At http://people.samba.org/bzr/jelmer/bzr-cia/trunk
------------------------------------------------------------
revno: 42
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij <[EMAIL PROTECTED]>
branch nick: trunk
timestamp: Fri 2008-10-10 16:08:33 +0200
message:
Handle errors when submitting pending.
=== modified file '__init__.py'
--- a/__init__.py 2008-10-10 14:05:14 +0000
+++ b/__init__.py 2008-10-10 14:08:33 +0000
@@ -177,6 +177,27 @@
print config.get_user_option('cia_project')
+def submit_pending(config):
+ import os
+ server = cia_connect(config)
+ cache_dir = cia_cache_dir()
+ for revid in os.listdir(cache_dir):
+ path = os.path.join(cache_dir, revid)
+ msg = open(path, 'r').read()
+ try:
+ server.hub.deliver(msg)
+ except xmlrpclib.ProtocolError, e:
+ error = e.errmsg
+ except socket.gaierror, (_, errmsg):
+ error = errmsg
+ except socket.error, (_, errmsg):
+ error = errmsg
+ if error is not None:
+ warning("Submitting %s failed: %s" % (revid, error))
+ else:
+ os.path.remove(path)
+
+
class cmd_cia_submit(Command):
"""Submit a revision to CIA
@@ -193,14 +214,7 @@
raise BzrCommandError("--pending and specifying a branch are
mutually exclusive")
if pending:
from bzrlib.config import GlobalConfig
- import os
- server = cia_connect(GlobalConfig())
- cache_dir = cia_cache_dir()
- for revid in os.listdir(cache_dir):
- path = os.path.join(cache_dir, revid)
- msg = open(path, 'r').read()
- server.hub.deliver(msg)
- os.path.remove(path)
+ submit_pending(GlobalConfig())
else:
if branch is not None:
branch = "."
--
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits