~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: mbp at sourcefrog
  • Date: 2005-03-09 04:08:15 UTC
  • Revision ID: mbp@sourcefrog.net-20050309040815-13242001617e4a06
import from baz patch-364

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from inventory import InventoryEntry, Inventory
30
30
from osutils import isdir, quotefn, isfile, uuid, sha_file, username, chomp, \
31
31
     format_date, compact_date, pumpfile, user_email, rand_bytes, splitpath, \
32
 
     joinpath, sha_string, file_kind, local_time_offset
 
32
     joinpath, sha_string, file_kind
33
33
from store import ImmutableStore
34
34
from revision import Revision
35
35
from errors import bailout
329
329
        return self.working_tree().unknowns()
330
330
 
331
331
 
332
 
    def commit(self, message, timestamp=None, timezone=None,
333
 
               committer=None,
 
332
    def commit(self, message, timestamp=None, committer=None,
334
333
               verbose=False):
335
334
        """Commit working copy as a new revision.
336
335
        
464
463
        if committer == None:
465
464
            committer = username()
466
465
 
467
 
        if timezone == None:
468
 
            timezone = local_time_offset()
469
 
 
470
466
        mutter("building commit log message")
471
467
        rev = Revision(timestamp=timestamp,
472
 
                       timezone=timezone,
473
468
                       committer=committer,
474
469
                       precursor = self.last_patch(),
475
470
                       message = message,
612
607
 
613
608
 
614
609
 
615
 
    def write_log(self, show_timezone='original'):
 
610
    def write_log(self, utc=False):
616
611
        """Write out human-readable log of commits to this branch
617
612
 
618
613
        :param utc: If true, show dates in universal time, not local time."""
619
 
        ## TODO: Option to choose either original, utc or local timezone
620
614
        revno = 1
621
615
        precursor = None
622
616
        for p in self.revision_history():
626
620
            ##print 'revision-hash:', p
627
621
            rev = self.get_revision(p)
628
622
            print 'committer:', rev.committer
629
 
            print 'timestamp: %s' % (format_date(rev.timestamp, rev.timezone or 0,
630
 
                                                 show_timezone))
 
623
            print 'timestamp: %s' % (format_date(rev.timestamp, utc))
631
624
 
632
625
            ## opportunistic consistency check, same as check_patch_chaining
633
626
            if rev.precursor != precursor: