/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1205
1205
 
1206
1206
    To retrieve the branch as of a particular revision, supply the --revision
1207
1207
    parameter, as in "branch foo/bar -r 5".
 
1208
 
 
1209
    The synonyms 'clone' and 'get' for this command are deprecated.
1208
1210
    """
1209
1211
 
1210
1212
    _see_also = ['checkout']
1240
1242
            files_from=None):
1241
1243
        from bzrlib import switch as _mod_switch
1242
1244
        from bzrlib.tag import _merge_tags_if_possible
 
1245
        if self.invoked_as in ['get', 'clone']:
 
1246
            ui.ui_factory.show_user_warning(
 
1247
                'deprecated_command',
 
1248
                deprecated_name=self.invoked_as,
 
1249
                recommended_name='branch',
 
1250
                deprecated_in_version='2.4')
1243
1251
        accelerator_tree, br_from = bzrdir.BzrDir.open_tree_or_branch(
1244
1252
            from_location)
1245
1253
        if not (hardlink or files_from):
2788
2796
            bzr ignore "RE:(?!debian/).*"
2789
2797
        
2790
2798
        Ignore everything except the "local" toplevel directory,
2791
 
        but always ignore "*~" autosave files, even under local/::
 
2799
        but always ignore autosave files ending in ~, even under local/::
2792
2800
        
2793
2801
            bzr ignore "*"
2794
2802
            bzr ignore "!./local"
3106
3114
      to trigger updates to external systems like bug trackers. The --fixes
3107
3115
      option can be used to record the association between a revision and
3108
3116
      one or more bugs. See ``bzr help bugs`` for details.
3109
 
 
3110
 
      A selective commit may fail in some cases where the committed
3111
 
      tree would be invalid. Consider::
3112
 
  
3113
 
        bzr init foo
3114
 
        mkdir foo/bar
3115
 
        bzr add foo/bar
3116
 
        bzr commit foo -m "committing foo"
3117
 
        bzr mv foo/bar foo/baz
3118
 
        mkdir foo/bar
3119
 
        bzr add foo/bar
3120
 
        bzr commit foo/bar -m "committing bar but not baz"
3121
 
  
3122
 
      In the example above, the last commit will fail by design. This gives
3123
 
      the user the opportunity to decide whether they want to commit the
3124
 
      rename at the same time, separately first, or not at all. (As a general
3125
 
      rule, when in doubt, Bazaar has a policy of Doing the Safe Thing.)
3126
3117
    """
3127
 
    # TODO: Run hooks on tree to-be-committed, and after commit.
3128
 
 
3129
 
    # TODO: Strict commit that fails if there are deleted files.
3130
 
    #       (what does "deleted files" mean ??)
3131
 
 
3132
 
    # TODO: Give better message for -s, --summary, used by tla people
3133
 
 
3134
 
    # XXX: verbose currently does nothing
3135
3118
 
3136
3119
    _see_also = ['add', 'bugs', 'hooks', 'uncommit']
3137
3120
    takes_args = ['selected*']
3169
3152
             Option('show-diff', short_name='p',
3170
3153
                    help='When no message is supplied, show the diff along'
3171
3154
                    ' with the status summary in the message editor.'),
 
3155
             Option('lossy', 
 
3156
                    help='When committing to a foreign version control '
 
3157
                    'system do not push data that can not be natively '
 
3158
                    'represented.'),
3172
3159
             ]
3173
3160
    aliases = ['ci', 'checkin']
3174
3161
 
3193
3180
 
3194
3181
    def run(self, message=None, file=None, verbose=False, selected_list=None,
3195
3182
            unchanged=False, strict=False, local=False, fixes=None,
3196
 
            author=None, show_diff=False, exclude=None, commit_time=None):
 
3183
            author=None, show_diff=False, exclude=None, commit_time=None,
 
3184
            lossy=False):
3197
3185
        from bzrlib.errors import (
3198
3186
            PointlessCommit,
3199
3187
            ConflictsInTree,
3213
3201
                raise errors.BzrCommandError(
3214
3202
                    "Could not parse --commit-time: " + str(e))
3215
3203
 
3216
 
        # TODO: Need a blackbox test for invoking the external editor; may be
3217
 
        # slightly problematic to run this cross-platform.
3218
 
 
3219
 
        # TODO: do more checks that the commit will succeed before
3220
 
        # spending the user's valuable time typing a commit message.
3221
 
 
3222
3204
        properties = {}
3223
3205
 
3224
3206
        tree, selected_list = WorkingTree.open_containing_paths(selected_list)
3301
3283
                        reporter=None, verbose=verbose, revprops=properties,
3302
3284
                        authors=author, timestamp=commit_stamp,
3303
3285
                        timezone=offset,
3304
 
                        exclude=tree.safe_relpath_files(exclude))
 
3286
                        exclude=tree.safe_relpath_files(exclude),
 
3287
                        lossy=lossy)
3305
3288
        except PointlessCommit:
3306
3289
            raise errors.BzrCommandError("No changes to commit."
3307
 
                              " Use --unchanged to commit anyhow.")
 
3290
                " Please 'bzr add' the files you want to commit, or use"
 
3291
                " --unchanged to force an empty commit.")
3308
3292
        except ConflictsInTree:
3309
3293
            raise errors.BzrCommandError('Conflicts detected in working '
3310
3294
                'tree.  Use "bzr conflicts" to list, "bzr resolve FILE" to'
4730
4714
            annotate_file_tree(wt, file_id, self.outf, long, all,
4731
4715
                show_ids=show_ids)
4732
4716
        else:
4733
 
            file_version = tree.inventory[file_id].revision
 
4717
            file_version = tree.get_file_revision(file_id)
4734
4718
            annotate_file(branch, file_version, file_id, long, all, self.outf,
4735
4719
                          show_ids=show_ids)
4736
4720