hgbook.red-bean.com, hook-writing, and documentation

Benoit Boissinot benoit.boissinot at ens-lyon.org
Sat Apr 24 17:48:58 CDT 2010


On Sat, Apr 24, 2010 at 04:48:30PM -0400, Greg Ward wrote:
> On Fri, Apr 23, 2010 at 9:10 AM, Ben Sizer <bens at monumentalgames.com> wrote:
> > I also found out that "for filename in repo[none]", despite the docs
> > implying that it would iterate over the files you've changed,
> > actually in my case iterates over every single file in the
> > repository. Rather strange. (But no doubt someone who understands
> > Mercurial better than I would disagree.) Iterating over
> > repo[none].files() was what I needed.
> 
> Are you reading http://mercurial.selenic.com/wiki/MercurialApi,
> section 5 "Change Contexts"?  If so, it seems fairly clear to me:
> 
>   * for filename in changectx - loops over all files in the changeset
> (in sorted order)
> [...]
>   * ctx.files() - the files changed in the changeset
> 
> I would hope you get the same behaviour for a changectx (representing
> an actual changeset) and repo[None], which is actually a workingctx
> object representing the working dir (what will become your next
> changeset).  It sounds to me like the behaviour you saw confirms that,
> and it's exactly what I would have expected from the docs in that wiki
> page.

for f in repo[None] returns (on purpose, according to Matt)
changed+added+clean+modified+*unknown*.

Benoit

-- 
:wq


More information about the Mercurial mailing list