~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2005-09-14 20:06:48 UTC
  • mto: (1185.1.29)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: abentley@panoramicfeedback.com-20050914200648-030b6c1e34fabaa6
Removed unused dir parameter from ExceptionConflictHandler

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
    directory is shown.  Otherwise, only the status of the specified
63
63
    files or directories is reported.  If a directory is given, status
64
64
    is reported for everything inside that directory.
 
65
    """
65
66
 
66
 
    If a revision is specified, the changes since that revision are shown.
67
 
    """
68
67
    takes_args = ['file*']
69
 
    takes_options = ['all', 'show-ids', 'revision']
 
68
    takes_options = ['all', 'show-ids']
70
69
    aliases = ['st', 'stat']
71
70
    
72
71
    def run(self, all=False, show_ids=False, file_list=None):
145
144
    Therefore simply saying 'bzr add' will version all files that
146
145
    are currently unknown.
147
146
 
148
 
    TODO: Perhaps adding a file whose directly is not versioned should
149
 
    recursively add that parent, rather than giving an error?
 
147
    Adding a file whose parent directory is not versioned will
 
148
    implicitly add the parent, and so on up to the root. This means
 
149
    you should never need to explictly add a directory, they'll just
 
150
    get added when you add a file in the directory.
150
151
    """
151
152
    takes_args = ['file*']
152
153
    takes_options = ['verbose', 'no-recurse']
304
305
        from bzrlib.branch import pull_loc
305
306
        
306
307
        br_to = find_branch('.')
307
 
        stored_loc = None
308
 
        try:
309
 
            stored_loc = br_to.controlfile("x-pull", "rb").read().rstrip('\n')
310
 
        except IOError, e:
311
 
            if e.errno != errno.ENOENT:
312
 
                raise
 
308
        stored_loc = br_to.get_parent()
313
309
        if location is None:
314
310
            if stored_loc is None:
315
311
                raise BzrCommandError("No pull location known or specified.")
334
330
                
335
331
            merge(('.', -1), ('.', old_revno), check_clean=False)
336
332
            if location != stored_loc:
337
 
                br_to.controlfile("x-pull", "wb").write(location + "\n")
 
333
                br_to.set_parent(location)
338
334
        finally:
339
335
            rmtree(cache_root)
340
336
 
484
480
            print patchid
485
481
 
486
482
 
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_patch()):
493
 
            print revision_id
494
 
 
495
 
 
496
483
class cmd_directories(Command):
497
484
    """Display list of versioned directories in this branch."""
498
485
    def run(self):
545
532
    examples:
546
533
        bzr diff
547
534
        bzr diff -r1
548
 
        bzr diff -r1:2
 
535
        bzr diff -r1..2
549
536
    """
550
537
    
551
538
    takes_args = ['file*']
955
942
    aliases = ['ci', 'checkin']
956
943
 
957
944
    # TODO: Give better message for -s, --summary, used by tla people
958
 
 
959
 
    # XXX: verbose currently does nothing
960
945
    
961
946
    def run(self, message=None, file=None, verbose=True, selected_list=None,
962
947
            unchanged=False):
986
971
            message = codecs.open(file, 'rt', bzrlib.user_encoding).read()
987
972
 
988
973
        try:
989
 
            b.commit(message,
 
974
            b.commit(message, verbose=verbose,
990
975
                     specific_files=selected_list,
991
976
                     allow_pointless=unchanged)
992
977
        except PointlessCommit:
1310
1295
                    print "Using last location: %s" % parent
1311
1296
                remote = parent
1312
1297
        elif parent is None:
1313
 
            # We only update x-pull if it did not exist, missing should not change the parent
1314
 
            b.controlfile('x-pull', 'wb').write(remote + '\n')
 
1298
            # We only update parent if it did not exist, missing should not change the parent
 
1299
            b.set_parent(remote)
1315
1300
        br_remote = find_branch(remote)
1316
1301
 
1317
1302
        return show_missing(b, br_remote, verbose=verbose, quiet=quiet)