# HG changeset patch # User Bryan O'Sullivan # Date 1121857283 28800 # Node ID 91ca3afab8e8efb58c4a97ac80a0fc50a342e0b0 # Parent d2dc7663d512a581f7ca8b984443b161d07277e8 Add name matching to status command. diff --git a/doc/hg.1.txt b/doc/hg.1.txt --- a/doc/hg.1.txt +++ b/doc/hg.1.txt @@ -319,8 +319,10 @@ serve [options]:: -n, --name name to show in web pages (default: working dir) -t, --templatedir web templates to use -status:: - Show changed files in the working directory. +status [options] [files]:: + Show changed files in the working directory. If no names are + given, all files are shown. Otherwise, only files matching the + given names are shown. The codes used to show the status of files are: @@ -329,6 +331,11 @@ status:: R = removed ? = not tracked + options: + + -I, --include include directories matching the given patterns + -X, --exclude exclude directories matching the given patterns + tag [-l -t -d -u ] [revision]:: Name a particular revision using . diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -980,7 +980,7 @@ def serve(ui, repo, **opts): ui.status('listening at http://%s/\n' % addr) httpd.serve_forever() -def status(ui, repo): +def status(ui, repo, *pats, **opts): '''show changed files in the working directory C = changed @@ -988,7 +988,8 @@ def status(ui, repo): R = removed ? = not tracked''' - (c, a, d, u) = repo.changes() + (c, a, d, u) = repo.changes(match = matchpats(ui, repo.getcwd(), + pats, opts)) (c, a, d, u) = map(lambda x: relfilter(repo, x), (c, a, d, u)) for f in c: @@ -1192,7 +1193,10 @@ table = { ('', 'stdio', None, 'for remote clients'), ('t', 'templates', "", 'template map')], "hg serve [OPTION]..."), - "^status": (status, [], 'hg status'), + "^status": (status, + [('I', 'include', [], 'include path in search'), + ('X', 'exclude', [], 'exclude path from search')], + 'hg status [OPTION]... [FILE]...'), "tag": (tag, [('l', 'local', None, 'make the tag local'),