~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to obsolete/baz2bzr

  • Committer: Aaron Bentley
  • Date: 2007-06-11 05:08:34 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20070611050834-wcbta2pfitcuopku
fix long-line detection

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#    along with this program; if not, write to the Free Software
18
18
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
19
 
20
 
from baz_import import import_version, UserError
21
 
from progress import rewriting_supported
 
20
import sys
 
21
from errors import NoPyBaz
 
22
try:
 
23
    from baz_import import import_version, UserError
 
24
except NoPyBaz:
 
25
    print >> sys.stderr, "This command requires PyBaz.  Please ensure that it is installed."
 
26
    sys.exit(1)
 
27
 
22
28
import pybaz
23
 
import sys
24
29
import os.path
25
30
 
26
31
def main(args):
67
72
        else:
68
73
            return 0
69
74
    if len(args) == 2:
70
 
        version,output_dir = args[1]
 
75
        version,output_dir = args
71
76
            
72
77
    elif len(args) == 1:
73
78
        output_dir = args[0]
85
90
            return 1
86
91
        
87
92
    try:
88
 
        fancy = rewriting_supported()
89
93
        import_version(output_dir, version,
90
94
            verbose=opts.verbose, fast=opts.fast,
91
95
            dry_run=opts.dry_run, max_count=opts.max_count,
92
 
            skip_symlinks=opts.skip_symlinks, fancy=fancy)
 
96
            skip_symlinks=opts.skip_symlinks)
93
97
        return 0
94
98
    except UserError, e:
95
99
        print e