/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

  • Committer: Robert Collins
  • Date: 2007-09-04 04:12:07 UTC
  • mfrom: (2794 +trunk)
  • mto: (2592.3.126 repository)
  • mto: This revision was merged to the branch mainline in revision 2795.
  • Revision ID: robertc@robertcollins.net-20070904041207-zb3l8hfco0sp6hu8
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
""")
61
61
 
62
62
from bzrlib.commands import Command, display_command
63
 
from bzrlib.option import ListOption, Option, RegistryOption
 
63
from bzrlib.option import ListOption, Option, RegistryOption, custom_help
64
64
from bzrlib.progress import DummyProgress, ProgressPhase
65
65
from bzrlib.trace import mutter, note, log_error, warning, is_quiet, info
66
66
 
152
152
    To see ignored files use 'bzr ignored'.  For details on the
153
153
    changes to file texts, use 'bzr diff'.
154
154
    
155
 
    --short gives a status flags for each item, similar to the SVN's status
156
 
    command.
 
155
    Note that --short or -S gives status flags for each item, similar
 
156
    to Subversion's status command. To get output similar to svn -q,
 
157
    use bzr -SV.
157
158
 
158
159
    If no arguments are specified, the status of the entire working
159
160
    directory is shown.  Otherwise, only the status of the specified
168
169
    
169
170
    takes_args = ['file*']
170
171
    takes_options = ['show-ids', 'revision', 'change',
171
 
                     Option('short', help='Give short SVN-style status lines.'),
172
 
                     Option('versioned', help='Only show versioned files.')]
 
172
                     Option('short', help='Use short status indicators.',
 
173
                            short_name='S'),
 
174
                     Option('versioned', help='Only show versioned files.',
 
175
                            short_name='V')
 
176
                     ]
173
177
    aliases = ['st', 'stat']
174
178
 
175
179
    encoding_type = 'replace'
573
577
 
574
578
    _see_also = ['push', 'update', 'status-flags']
575
579
    takes_options = ['remember', 'overwrite', 'revision',
576
 
        Option('verbose', short_name='v',
 
580
        custom_help('verbose',
577
581
            help='Show logs of pulled revisions.'),
578
582
        Option('directory',
579
583
            help='Branch to pull into, '
1058
1062
    takes_options = ['verbose']
1059
1063
 
1060
1064
    @display_command
1061
 
    def run(self, location=None, verbose=0):
 
1065
    def run(self, location=None, verbose=False):
 
1066
        if verbose:
 
1067
            noise_level = 2
 
1068
        else:
 
1069
            noise_level = 0
1062
1070
        from bzrlib.info import show_bzrdir_info
1063
1071
        show_bzrdir_info(bzrdir.BzrDir.open_containing(location)[0],
1064
 
                         verbose=verbose)
 
1072
                         verbose=noise_level)
1065
1073
 
1066
1074
 
1067
1075
class cmd_remove(Command):
1626
1634
            Option('timezone',
1627
1635
                   type=str,
1628
1636
                   help='Display timezone as local, original, or utc.'),
1629
 
            Option('verbose',
1630
 
                   short_name='v',
 
1637
            custom_help('verbose',
1631
1638
                   help='Show files changed in each revision.'),
1632
1639
            'show-ids',
1633
1640
            'revision',
1963
1970
        if not tree.path2id('.bzrignore'):
1964
1971
            tree.add(['.bzrignore'])
1965
1972
 
 
1973
        ignored = globbing.Globster(name_pattern_list)
 
1974
        matches = []
 
1975
        tree.lock_read()
 
1976
        for entry in tree.list_files():
 
1977
            id = entry[3]
 
1978
            if id is not None:
 
1979
                filename = entry[0]
 
1980
                if ignored.match(filename):
 
1981
                    matches.append(filename.encode('utf-8'))
 
1982
        tree.unlock()
 
1983
        if len(matches) > 0:
 
1984
            print "Warning: the following files are version controlled and" \
 
1985
                  " match your ignore pattern:\n%s" % ("\n".join(matches),)
1966
1986
 
1967
1987
class cmd_ignored(Command):
1968
1988
    """List ignored files and the patterns that matched them.
2227
2247
            properties.append('%s fixed' % bug_url)
2228
2248
        return '\n'.join(properties)
2229
2249
 
2230
 
    def run(self, message=None, file=None, verbose=True, selected_list=None,
 
2250
    def run(self, message=None, file=None, verbose=False, selected_list=None,
2231
2251
            unchanged=False, strict=False, local=False, fixes=None,
2232
2252
            author=None, show_diff=False):
2233
2253
        from bzrlib.commit import (
2287
2307
                raise errors.BzrCommandError("empty commit message specified")
2288
2308
            return my_message
2289
2309
 
2290
 
        if verbose:
 
2310
        if verbose or not is_quiet():
2291
2311
            reporter = ReportCommitToLog()
2292
2312
        else:
2293
2313
            reporter = NullCommitReporter()
3022
3042
    from the target revision.  So you can use revert to "undelete" a file by
3023
3043
    name.  If you name a directory, all the contents of that directory will be
3024
3044
    reverted.
 
3045
 
 
3046
    Any files that have been newly added since that revision will be deleted,
 
3047
    with a backup kept if appropriate.  Directories containing unknown files
 
3048
    will not be deleted.
3025
3049
    """
3026
3050
 
3027
3051
    _see_also = ['cat', 'export']