~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2009-11-26 01:42:06 UTC
  • mfrom: (4827 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4828.
  • Revision ID: mbp@sourcefrog.net-20091126014206-qvf8jfpwpro558r4
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    rename_map,
45
45
    revision as _mod_revision,
46
46
    symbol_versioning,
 
47
    timestamp,
47
48
    transport,
48
49
    ui,
49
50
    urlutils,
849
850
            # All entries reference existing inventory items, so fix them up
850
851
            # for cicp file-systems.
851
852
            rel_names = tree.get_canonical_inventory_paths(rel_names)
852
 
            for pair in tree.move(rel_names[:-1], rel_names[-1], after=after):
853
 
                self.outf.write("%s => %s\n" % pair)
 
853
            for src, dest in tree.move(rel_names[:-1], rel_names[-1], after=after):
 
854
                if not is_quiet():
 
855
                    self.outf.write("%s => %s\n" % (src, dest))
854
856
        else:
855
857
            if len(names_list) != 2:
856
858
                raise errors.BzrCommandError('to mv multiple files the'
900
902
            dest = osutils.pathjoin(dest_parent, dest_tail)
901
903
            mutter("attempting to move %s => %s", src, dest)
902
904
            tree.rename_one(src, dest, after=after)
903
 
            self.outf.write("%s => %s\n" % (src, dest))
 
905
            if not is_quiet():
 
906
                self.outf.write("%s => %s\n" % (src, dest))
904
907
 
905
908
 
906
909
class cmd_pull(Command):
1829
1832
 
1830
1833
            bzr diff -r1
1831
1834
 
1832
 
        Difference between revision 2 and revision 1::
1833
 
 
1834
 
            bzr diff -r1..2
1835
 
 
1836
 
        Difference between revision 2 and revision 1 for branch xxx::
1837
 
 
1838
 
            bzr diff -r1..2 xxx
 
1835
        Difference between revision 3 and revision 1::
 
1836
 
 
1837
            bzr diff -r1..3
 
1838
 
 
1839
        Difference between revision 3 and revision 1 for branch xxx::
 
1840
 
 
1841
            bzr diff -r1..3 xxx
 
1842
 
 
1843
        To see the changes introduced in revision X::
 
1844
        
 
1845
            bzr diff -cX
 
1846
 
 
1847
        Note that in the case of a merge, the -c option shows the changes
 
1848
        compared to the left hand parent. To see the changes against
 
1849
        another parent, use::
 
1850
 
 
1851
            bzr diff -r<chosen_parent>..X
 
1852
 
 
1853
        The changes introduced by revision 2 (equivalent to -r1..2)::
 
1854
 
 
1855
            bzr diff -c2
1839
1856
 
1840
1857
        Show just the differences for file NEWS::
1841
1858
 
2574
2591
 
2575
2592
    See ``bzr help patterns`` for details on the syntax of patterns.
2576
2593
 
 
2594
    If a .bzrignore file does not exist, the ignore command
 
2595
    will create one and add the specified files or patterns to the newly
 
2596
    created file. The ignore command will also automatically add the 
 
2597
    .bzrignore file to be versioned. Creating a .bzrignore file without
 
2598
    the use of the ignore command will require an explicit add command.
 
2599
 
2577
2600
    To remove patterns from the ignore list, edit the .bzrignore file.
2578
2601
    After adding, editing or deleting that file either indirectly by
2579
2602
    using this command or directly by using an editor, be sure to commit
2947
2970
             Option('strict',
2948
2971
                    help="Refuse to commit if there are unknown "
2949
2972
                    "files in the working tree."),
 
2973
             Option('commit-time', type=str,
 
2974
                    help="Manually set a commit time using commit date "
 
2975
                    "format, e.g. '2009-10-10 08:00:00 +0100'."),
2950
2976
             ListOption('fixes', type=str,
2951
2977
                    help="Mark a bug as being fixed by this revision "
2952
2978
                         "(see \"bzr help bugs\")."),
2959
2985
                         "the master branch until a normal commit "
2960
2986
                         "is performed."
2961
2987
                    ),
2962
 
              Option('show-diff',
2963
 
                     help='When no message is supplied, show the diff along'
2964
 
                     ' with the status summary in the message editor.'),
 
2988
             Option('show-diff',
 
2989
                    help='When no message is supplied, show the diff along'
 
2990
                    ' with the status summary in the message editor.'),
2965
2991
             ]
2966
2992
    aliases = ['ci', 'checkin']
2967
2993
 
2986
3012
 
2987
3013
    def run(self, message=None, file=None, verbose=False, selected_list=None,
2988
3014
            unchanged=False, strict=False, local=False, fixes=None,
2989
 
            author=None, show_diff=False, exclude=None):
 
3015
            author=None, show_diff=False, exclude=None, commit_time=None):
2990
3016
        from bzrlib.errors import (
2991
3017
            PointlessCommit,
2992
3018
            ConflictsInTree,
2998
3024
            make_commit_message_template_encoded
2999
3025
        )
3000
3026
 
 
3027
        commit_stamp = offset = None
 
3028
        if commit_time is not None:
 
3029
            try:
 
3030
                commit_stamp, offset = timestamp.parse_patch_date(commit_time)
 
3031
            except ValueError, e:
 
3032
                raise errors.BzrCommandError(
 
3033
                    "Could not parse --commit-time: " + str(e))
 
3034
 
3001
3035
        # TODO: Need a blackbox test for invoking the external editor; may be
3002
3036
        # slightly problematic to run this cross-platform.
3003
3037
 
3058
3092
                        specific_files=selected_list,
3059
3093
                        allow_pointless=unchanged, strict=strict, local=local,
3060
3094
                        reporter=None, verbose=verbose, revprops=properties,
3061
 
                        authors=author,
 
3095
                        authors=author, timestamp=commit_stamp,
 
3096
                        timezone=offset,
3062
3097
                        exclude=safe_relpath_files(tree, exclude))
3063
3098
        except PointlessCommit:
3064
3099
            # FIXME: This should really happen before the file is read in;
3614
3649
 
3615
3650
            bzr merge -r 81..82 ../bzr.dev
3616
3651
 
3617
 
        To apply a merge directive contained in /tmp/merge:
 
3652
        To apply a merge directive contained in /tmp/merge::
3618
3653
 
3619
3654
            bzr merge /tmp/merge
3620
3655
    """
4034
4069
    name.  If you name a directory, all the contents of that directory will be
4035
4070
    reverted.
4036
4071
 
4037
 
    Any files that have been newly added since that revision will be deleted,
4038
 
    with a backup kept if appropriate.  Directories containing unknown files
4039
 
    will not be deleted.
 
4072
    If you have newly added files since the target revision, they will be
 
4073
    removed.  If the files to be removed have been changed, backups will be
 
4074
    created as above.  Directories containing unknown files will not be
 
4075
    deleted.
4040
4076
 
4041
4077
    The working tree contains a list of pending merged revisions, which will
4042
4078
    be included as parents in the next commit.  Normally, revert clears that
4726
4762
    takes_options = [
4727
4763
        Option('inet',
4728
4764
               help='Serve on stdin/out for use from inetd or sshd.'),
4729
 
        RegistryOption('protocol', 
4730
 
               help="Protocol to serve.", 
 
4765
        RegistryOption('protocol',
 
4766
               help="Protocol to serve.",
4731
4767
               lazy_registry=('bzrlib.transport', 'transport_server_registry'),
4732
4768
               value_switches=True),
4733
4769
        Option('port',
4742
4778
        Option('allow-writes',
4743
4779
               help='By default the server is a readonly server.  Supplying '
4744
4780
                    '--allow-writes enables write access to the contents of '
4745
 
                    'the served directory and below.'
 
4781
                    'the served directory and below.  Note that ``bzr serve`` '
 
4782
                    'does not perform authentication, so unless some form of '
 
4783
                    'external authentication is arranged supplying this '
 
4784
                    'option leads to global uncontrolled write access to your '
 
4785
                    'file system.'
4746
4786
                ),
4747
4787
        ]
4748
4788
 
5671
5711
            try:
5672
5712
                shelver.run()
5673
5713
            finally:
5674
 
                shelver.work_tree.unlock()
 
5714
                shelver.finalize()
5675
5715
        except errors.UserAbort:
5676
5716
            return 0
5677
5717