hgext/purge.py
changeset 9072 59e5437bbcdc
parent 8936 1de6e7e1bb9f
child 9215 f6a880fa9cd7
equal deleted inserted replaced
9071:141e3ef20d84 9072:59e5437bbcdc
    30 import os, stat
    30 import os, stat
    31 
    31 
    32 def purge(ui, repo, *dirs, **opts):
    32 def purge(ui, repo, *dirs, **opts):
    33     '''removes files not tracked by Mercurial
    33     '''removes files not tracked by Mercurial
    34 
    34 
    35     Delete files not known to Mercurial. This is useful to test local
    35     Delete files not known to Mercurial. This is useful to test local and
    36     and uncommitted changes in an otherwise-clean source tree.
    36     uncommitted changes in an otherwise-clean source tree.
    37 
    37 
    38     This means that purge will delete:
    38     This means that purge will delete:
    39      - Unknown files: files marked with "?" by "hg status"
    39      - Unknown files: files marked with "?" by "hg status"
    40      - Empty directories: in fact Mercurial ignores directories unless
    40      - Empty directories: in fact Mercurial ignores directories unless they
    41        they contain files under source control management
    41        contain files under source control management
    42     But it will leave untouched:
    42     But it will leave untouched:
    43      - Modified and unmodified tracked files
    43      - Modified and unmodified tracked files
    44      - Ignored files (unless --all is specified)
    44      - Ignored files (unless --all is specified)
    45      - New files added to the repository (with "hg add")
    45      - New files added to the repository (with "hg add")
    46 
    46 
    47     If directories are given on the command line, only files in these
    47     If directories are given on the command line, only files in these
    48     directories are considered.
    48     directories are considered.
    49 
    49 
    50     Be careful with purge, as you could irreversibly delete some files
    50     Be careful with purge, as you could irreversibly delete some files you
    51     you forgot to add to the repository. If you only want to print the
    51     forgot to add to the repository. If you only want to print the list of
    52     list of files that this program would delete, use the --print
    52     files that this program would delete, use the --print option.
    53     option.
       
    54     '''
    53     '''
    55     act = not opts['print']
    54     act = not opts['print']
    56     eol = '\n'
    55     eol = '\n'
    57     if opts['print0']:
    56     if opts['print0']:
    58         eol = '\0'
    57         eol = '\0'