~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2005-09-16 09:19:54 UTC
  • Revision ID: mbp@sourcefrog.net-20050916091954-aee6d7be00db6354
- more docs in commit code

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