~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2011-09-25 01:18:55 UTC
  • mfrom: (776.2.1 unused-imports)
  • Revision ID: aaron@aaronbentley.com-20110925011855-3dil4ijgluvzq7q5
Remove unused imports, fix the importing of two error classes. (jelmer)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
import bzrlib
27
27
from bzrlib import revision as _mod_revision, trace, urlutils
28
 
import bzrlib.errors
29
28
from bzrlib.errors import (
30
29
    BzrCommandError,
31
30
    BzrError,
32
 
    ConnectionError,
33
31
    NotBranchError,
34
32
    NoSuchFile,
35
 
    NoWorkingTree,
36
 
    PermissionDenied,
37
 
    UnsupportedFormatError,
38
 
    TransportError,
39
33
    )
40
 
from bzrlib.bzrdir import BzrDir, BzrDirFormat
 
34
from bzrlib.bzrdir import BzrDir
41
35
from bzrlib.transport import get_transport
42
36
 
43
37
def temp_tree():
303
297
        if working_tree:
304
298
            clean, non_source = is_clean(tree)
305
299
            if not clean:
306
 
                raise bzrlib.errors.BzrCommandError(
 
300
                raise BzrCommandError(
307
301
                    'This tree has uncommitted changes or unknown'
308
302
                    ' (?) files.  Use "bzr status" to list them.')
309
303
                sys.exit(1)
319
313
            try:
320
314
                if not history_subset(push_location, tree.branch,
321
315
                                      _rsync=my_rsync):
322
 
                    raise bzrlib.errors.BzrCommandError(
 
316
                    raise BzrCommandError(
323
317
                        "Local branch is not a newer version of remote"
324
318
                        " branch.")
325
319
            except RsyncNoFile:
326
320
                if not empty_or_absent(push_location):
327
 
                    raise bzrlib.errors.BzrCommandError(
 
321
                    raise BzrCommandError(
328
322
                        "Remote location is not a bzr branch (or empty"
329
323
                        " directory)")
330
324
            except RsyncStreamIO:
331
 
                raise bzrlib.errors.BzrCommandError("Rsync could not use the"
 
325
                raise BzrCommandError("Rsync could not use the"
332
326
                    " specified location.  Please ensure that"
333
327
                    ' "%s" is of the form "machine:/path".' % push_location)
334
328
        trace.note("Pushing to %s", push_location)
355
349
    t._remote_path = lambda x: t.base
356
350
    try:
357
351
        lines = t.get('')
358
 
    except bzrlib.errors.NoSuchFile:
 
352
    except NoSuchFile:
359
353
        return
360
354
    expr = re.compile('<a[^>]*href="([^>]*)\/"[^>]*>', flags=re.I)
361
355
    for line in lines: