~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Eirik Nygaard
  • Date: 2005-09-27 11:21:32 UTC
  • mto: This revision was merged to the branch mainline in revision 201.
  • Revision ID: eirikald@pvv.ntnu.no-20050927112132-8e462198091bc0d9
Add check for rsync return code 12, error in rsync protocol data stream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
        proc.stdout.read()
174
174
        proc.stdout.close()
175
175
    proc.wait()
176
 
    if proc.returncode == 23:
 
176
    if proc.returncode == 12:
 
177
        raise RsyncStreamIO(target)
 
178
    elif proc.returncode == 23:
177
179
        raise RsyncNoFile(source)
178
180
    elif proc.returncode != 0:
179
181
        raise RsyncUnknownStatus(proc.returncode)
196
198
        proc.stderr.read()
197
199
        proc.stderr.close()
198
200
    proc.wait()
199
 
    if proc.returncode == 23:
 
201
    if proc.returncode == 12:
 
202
         raise RsyncStreamIO(target)
 
203
    elif proc.returncode == 23:
200
204
        raise RsyncNoFile(source)
201
205
    elif proc.returncode != 0:
202
206
        raise RsyncUnknownStatus(proc.returncode)
214
218
class RsyncNoFile(Exception):
215
219
    def __init__(self, path):
216
220
        Exception.__init__(self, "No such file %s" % path)
 
221
class RsyncStreamIO(Exception):
 
222
    def __init__(self, url):
 
223
        Exception.__init__(self, "Error in rsync protocol data stream %s\nTarget should be: machine:/path/to/repo" % url)
217
224
 
218
225
def get_revision_history(location):
219
226
    tempdir = tempfile.mkdtemp('push')