~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to baz_import.py

  • Committer: Aaron Bentley
  • Date: 2005-07-22 14:21:28 UTC
  • Revision ID: abentley@panoramicfeedback.com-20050722142128-d3438cab0870fe06
Fixed up the baz-import plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
from bzrlib import Branch
17
17
from bzrlib.commands import Command
 
18
 
 
19
class NoPyBaz(Exception):
 
20
    def __init__(self):
 
21
        Exception.__init__(self, "PyBaz is not installed.")
18
22
try:
19
23
    import pybaz
20
24
    import pybaz.errors
21
25
except ImportError:
22
 
    print "This command requires PyBaz.  Please ensure that it is installed."
23
 
    import sys
24
 
    sys.exit(1)
 
26
    raise NoPyBaz
25
27
from pybaz.backends.baz import null_cmd
26
28
import tempfile
27
29
import os
559
561
        to_location = os.path.realpath(str(to_location))
560
562
        if from_branch is not None:
561
563
            try:
562
 
                from_branch = pybaz.Version(version)
 
564
                from_branch = pybaz.Version(from_branch)
563
565
            except pybaz.errors.NamespaceError:
564
566
                print "%s is not a valid Arch branch." % from_branch
565
567
                return 1