~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-05-03 08:17:43 UTC
  • Revision ID: mbp@sourcefrog.net-20050503081743-688247ee4829434b
- cleanup of some imports

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
 
65
65
 
66
66
 
67
 
import sys, os, time, types, shutil, tempfile, fnmatch, difflib, os.path
 
67
import sys, os, time, os.path
68
68
from sets import Set
69
 
from pprint import pprint
70
 
from stat import *
71
 
from glob import glob
72
69
 
73
70
import bzrlib
74
 
from bzrlib.store import ImmutableStore
75
71
from bzrlib.trace import mutter, note, log_error
76
72
from bzrlib.errors import bailout, BzrError, BzrCheckError, BzrCommandError
77
73
from bzrlib.osutils import quotefn, pumpfile, isdir, isfile
80
76
from bzrlib import Branch, Inventory, InventoryEntry, ScratchBranch, BZRDIR, \
81
77
     format_date
82
78
 
83
 
BZR_DIFF_FORMAT = "## Bazaar-NG diff, format 0 ##\n"
84
 
BZR_PATCHNAME_FORMAT = 'cset:sha1:%s'
85
 
 
86
 
## standard representation
87
 
NONE_STRING = '(none)'
88
 
EMPTY = 'empty'
89
 
 
90
79
 
91
80
CMD_ALIASES = {
92
81
    '?':         'help',
547
536
        bzr lookup-revision 33
548
537
        """
549
538
    hidden = True
 
539
    takes_args = ['revno']
 
540
    
550
541
    def run(self, revno):
551
542
        try:
552
543
            revno = int(revno)
553
544
        except ValueError:
554
 
            raise BzrError("not a valid revision-number: %r" % revno)
555
 
 
556
 
        print Branch('.').lookup_revision(revno) or NONE_STRING
557
 
 
 
545
            raise BzrCommandError("not a valid revision-number: %r" % revno)
 
546
 
 
547
        print Branch('.').lookup_revision(revno)
558
548
 
559
549
 
560
550
class cmd_export(Command):
965
955
        cmdopts[k.replace('-', '_')] = v
966
956
 
967
957
    if profile:
968
 
        import hotshot
 
958
        import hotshot, tempfile
969
959
        pffileno, pfname = tempfile.mkstemp()
970
960
        try:
971
961
            prof = hotshot.Profile(pfname)