~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2007-08-21 01:32:29 UTC
  • mfrom: (2727 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2736.
  • Revision ID: aaron.bentley@utoronto.ca-20070821013229-miopsemz249tv0bl
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
568
568
    """
569
569
 
570
570
    _see_also = ['push', 'update', 'status-flags']
571
 
    takes_options = ['remember', 'overwrite', 'revision', 'verbose',
 
571
    takes_options = ['remember', 'overwrite', 'revision',
 
572
        Option('verbose', short_name='v',
 
573
            help='Show logs of pulled revisions.'),
572
574
        Option('directory',
573
575
            help='Branch to pull into, '
574
576
                 'rather than the one containing the working directory.',
640
642
 
641
643
        result.report(self.outf)
642
644
        if verbose:
643
 
            from bzrlib.log import show_changed_revisions
644
645
            new_rh = branch_to.revision_history()
645
 
            show_changed_revisions(branch_to, old_rh, new_rh,
646
 
                                   to_file=self.outf)
 
646
            log.show_changed_revisions(branch_to, old_rh, new_rh,
 
647
                                       to_file=self.outf)
647
648
 
648
649
 
649
650
class cmd_push(Command):
958
959
            except errors.NoWorkingTree:
959
960
                source.bzrdir.create_workingtree(revision_id)
960
961
                return
961
 
        try:
962
 
            os.mkdir(to_location)
963
 
        except OSError, e:
964
 
            if e.errno == errno.EEXIST:
965
 
                raise errors.BzrCommandError('Target directory "%s" already'
966
 
                                             ' exists.' % to_location)
967
 
            if e.errno == errno.ENOENT:
968
 
                raise errors.BzrCommandError('Parent of "%s" does not exist.'
969
 
                                             % to_location)
970
 
            else:
971
 
                raise
972
962
        source.create_checkout(to_location, revision_id, lightweight)
973
963
 
974
964
 
2145
2135
    committed.  If a directory is specified then the directory and everything 
2146
2136
    within it is committed.
2147
2137
 
 
2138
    If author of the change is not the same person as the committer, you can
 
2139
    specify the author's name using the --author option. The name should be
 
2140
    in the same format as a committer-id, e.g. "John Doe <jdoe@example.com>".
 
2141
 
2148
2142
    A selected-file commit may fail in some cases where the committed
2149
2143
    tree would be invalid. Consider::
2150
2144
 
2191
2185
                    "files in the working tree."),
2192
2186
             ListOption('fixes', type=str,
2193
2187
                    help="Mark a bug as being fixed by this revision."),
 
2188
             Option('author', type=str,
 
2189
                    help="Set the author's name, if it's different "
 
2190
                         "from the committer."),
2194
2191
             Option('local',
2195
2192
                    help="Perform a local commit in a bound "
2196
2193
                         "branch.  Local commits are not pushed to "
2223
2220
        return '\n'.join(properties)
2224
2221
 
2225
2222
    def run(self, message=None, file=None, verbose=True, selected_list=None,
2226
 
            unchanged=False, strict=False, local=False, fixes=None):
 
2223
            unchanged=False, strict=False, local=False, fixes=None,
 
2224
            author=None):
2227
2225
        from bzrlib.commit import (NullCommitReporter, ReportCommitToLog)
2228
2226
        from bzrlib.errors import (PointlessCommit, ConflictsInTree,
2229
2227
                StrictCommitFailed)
2280
2278
            tree.commit(message_callback=get_message,
2281
2279
                        specific_files=selected_list,
2282
2280
                        allow_pointless=unchanged, strict=strict, local=local,
2283
 
                        reporter=reporter, revprops=properties)
 
2281
                        reporter=reporter, revprops=properties,
 
2282
                        author=author)
2284
2283
        except PointlessCommit:
2285
2284
            # FIXME: This should really happen before the file is read in;
2286
2285
            # perhaps prepare the commit; get the message; then actually commit
2529
2528
        if cache_dir is not None:
2530
2529
            tree_creator.TreeCreator.CACHE_ROOT = osutils.abspath(cache_dir)
2531
2530
        if not list_only:
2532
 
            show_version(show_config=False, show_copyright=False)
 
2531
            print 'testing: %s' % (osutils.realpath(sys.argv[0]),)
 
2532
            print '   %s (%s python%s)' % (
 
2533
                    bzrlib.__path__[0],
 
2534
                    bzrlib.version_string,
 
2535
                    '.'.join(map(str, sys.version_info)),
 
2536
                    )
2533
2537
        print
2534
2538
        if testspecs_list is not None:
2535
2539
            pattern = '|'.join(testspecs_list)