[PATCH 2 of 2] Allow hgwebdir collections to follow symlinks

Eric M. Hopper hopper at omnifarious.org
Tue Aug 7 00:30:45 CDT 2007


On Mon, 2007-08-06 at 23:57 +0200, Benoit Boissinot wrote:
> On 8/6/07, Eric Hopper <hopper at omnifarious.org> wrote:
> > 2 files changed, 13 insertions(+), 2 deletions(-)
> > mercurial/hgweb/hgwebdir_mod.py |    2 +-
> > mercurial/util.py               |   13 ++++++++++++-
> >
> 
> iirc set isn't available in python 2.3

Yes, it is.  Look higher up in util.py.  A previous patch I managed to
get accepted puts 'set' and 'frozenset' in the namespace of the util
module.  In Python 2.3 it uses pure Python types that are based on dict,
and in 2.4 and higher it uses the built in set types.

> Isn't os.lstat what you want to use ? (or do you want to disallow two
> symlinks pointing to the same repo ?)

Paying attention to the device and inode of the symlink itself will
indeed prevent cycles.  But IMHO, you and up with many fewer crazy
topologies and weird instances of the same thing showing up in lots of
places if you pay attention to where the symlink goes instead.

IMHO, the main problem with the code is that it doesn't record the dev
and inode of the directories it gets to without symlinks.  Maybe I shall
change that and resubmit.

> (and a minor nitpick: no spaces are usually added around keyword
> argument in the rest of the mercurial source)

Since I think that I should change the one thing I just mentioned, I
will fix this too.

Thanks,
-- 
A word is nothing more or less than the series of historical
connotations given to it. That's HOW we derive meaning, and to claim
that there is an arbitrary meaning of words above and beyond the way
people use them is a blatant misunderstanding of the nature of language.
-- Anonymous blogger
-- Eric Hopper - http://www.omnifarious.org/~hopper/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: This is a digitally signed message part
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20070806/54d24e5b/attachment.pgp 


More information about the Mercurial-devel mailing list