~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2005-09-05 09:11:03 UTC
  • Revision ID: mbp@sourcefrog.net-20050905091103-1e51e146be0f08b4
- add test for deserialization from a canned XML inventory

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
    takes_args = ['revision_id']
93
93
    
94
94
    def run(self, revision_id):
95
 
        b = find_branch('.')
96
 
        sys.stdout.write(b.get_revision_xml_file(revision_id).read())
 
95
        from bzrlib.xml import pack_xml
 
96
        pack_xml(find_branch('.').get_revision(revision_id), sys.stdout)
97
97
 
98
98
 
99
99
class cmd_revno(Command):
103
103
    def run(self):
104
104
        print find_branch('.').revno()
105
105
 
106
 
 
107
106
class cmd_revision_info(Command):
108
107
    """Show revision number and revision id for a given revision identifier.
109
108
    """
484
483
            print patchid
485
484
 
486
485
 
487
 
class cmd_ancestry(Command):
488
 
    """List all revisions merged into this branch."""
489
 
    hidden = True
490
 
    def run(self):
491
 
        b = find_branch('.')
492
 
        for revision_id in b.get_ancestry(b.last_revision()):
493
 
            print revision_id
494
 
 
495
 
 
496
486
class cmd_directories(Command):
497
487
    """Display list of versioned directories in this branch."""
498
488
    def run(self):
891
881
        import os.path
892
882
        b = find_branch('.')
893
883
        if revision is None:
894
 
            rev_id = b.last_revision()
 
884
            rev_id = b.last_patch()
895
885
        else:
896
886
            if len(revision) != 1:
897
887
                raise BzrError('bzr export --revision takes exactly 1 argument')
955
945
    aliases = ['ci', 'checkin']
956
946
 
957
947
    # TODO: Give better message for -s, --summary, used by tla people
958
 
 
959
 
    # XXX: verbose currently does nothing
960
948
    
961
949
    def run(self, message=None, file=None, verbose=True, selected_list=None,
962
950
            unchanged=False):
986
974
            message = codecs.open(file, 'rt', bzrlib.user_encoding).read()
987
975
 
988
976
        try:
989
 
            b.commit(message,
 
977
            b.commit(message, verbose=verbose,
990
978
                     specific_files=selected_list,
991
979
                     allow_pointless=unchanged)
992
980
        except PointlessCommit:
1131
1119
        history_1 = branch1.revision_history()
1132
1120
        history_2 = branch2.revision_history()
1133
1121
 
1134
 
        last1 = branch1.last_revision()
1135
 
        last2 = branch2.last_revision()
 
1122
        last1 = branch1.last_patch()
 
1123
        last2 = branch2.last_patch()
1136
1124
 
1137
1125
        source = MultipleRevisionSources(branch1, branch2)
1138
1126
        
1284
1272
        shellcomplete.shellcomplete(context)
1285
1273
 
1286
1274
 
1287
 
class cmd_fetch(Command):
1288
 
    """Copy in history from another branch but don't merge it.
1289
 
 
1290
 
    This is an internal method used for pull and merge."""
1291
 
    hidden = True
1292
 
    takes_args = ['from_branch', 'to_branch']
1293
 
    def run(self, from_branch, to_branch):
1294
 
        from bzrlib.fetch import Fetcher
1295
 
        from bzrlib.branch import Branch
1296
 
        from_b = Branch(from_branch)
1297
 
        to_b = Branch(to_branch)
1298
 
        Fetcher(to_b, from_b)
1299
 
        
1300
 
 
1301
 
 
1302
1275
class cmd_missing(Command):
1303
1276
    """What is missing in this branch relative to other branch.
1304
1277
    """
1305
 
    # TODO: rewrite this in terms of ancestry so that it shows only
1306
 
    # unmerged things
1307
 
    
1308
1278
    takes_args = ['remote?']
1309
1279
    aliases = ['mis', 'miss']
1310
1280
    # We don't have to add quiet to the list, because