[PATCH 1 of 1] manifest: add --local option to list current directory state (issue2140)
Nicolas Dumazet
nicdumz at gmail.com
Fri Apr 16 05:03:48 CDT 2010
2010/4/16 Matt Mackall <mpm at selenic.com>:
> On Fri, 2010-04-16 at 15:14 +0900, Nicolas Dumazet wrote:
>> # HG changeset patch
>> # User Nicolas Dumazet <nicdumz.commits at gmail.com>
>> # Date 1271394625 -32400
>> # Node ID 98028d5691a751140ec32c641c0bf14c1703252a
>> # Parent 342b20693f5b21fae0da8ce8198b99521ff7e868
>> manifest: add --local option to list current directory state (issue2140)
>>
>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>> --- a/mercurial/commands.py
>> +++ b/mercurial/commands.py
>> @@ -11,7 +11,7 @@
>> import os, re, sys, difflib, time, tempfile
>> import hg, util, revlog, bundlerepo, extensions, copies, error
>> import patch, help, mdiff, url, encoding, templatekw
>> -import archival, changegroup, cmdutil, sshserver, hbisect
>> +import archival, changegroup, cmdutil, sshserver, hbisect, context
>> from hgweb import server, hgweb_mod, hgwebdir_mod
>> import merge as mergemod
>> import minirst
>> @@ -2199,7 +2199,7 @@
>> count += 1
>> displayer.close()
>>
>> -def manifest(ui, repo, node=None, rev=None):
>> +def manifest(ui, repo, node=None, rev=None, local=False):
>> """output the current or given revision of the project manifest
>>
>> Print a list of version controlled files for the given revision.
>> @@ -2216,8 +2216,15 @@
>> if not node:
>> node = rev
>>
>> + if local and node:
>> + raise util.Abort(_("--rev and --local are incompatible"))
>> +
>> + if local:
>> + ctx = context.workingctx(repo)
>
> I think you can use repo[''] here?
No?
But investigating more, repo[None] seems to do this. That'll produce a
rather elegant patch :)
--
Nicolas Dumazet — NicDumZ
More information about the Mercurial-devel
mailing list