~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Jelmer Vernooij
  • Date: 2011-08-29 17:00:45 UTC
  • mto: This revision was merged to the branch mainline in revision 778.
  • Revision ID: jelmer@samba.org-20110829170045-j1yns6q2e6jb236i
Remove unused imports and fix two imports.

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: