Hello,
Na Fri, Jul 13, 2007 at 07:08:39PM +0200, lars <lists@...> pisal(=
a):
> Does that mean, that the "_darcs" directory can be at any directory level=
above
> (and including) the directory of the po file?
> Then maybe it would be better just to walk all directories up to find it.
that's not a bad idea, but it was not supported even before the oo
rewrite and my patch was a fix, not an improvement :)
> I attached a proposal for this - please test it. But maybe I just went in=
to
> the wrong direction, as I never used darcs.
2007-07-13 20:25:24: Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/Pootle/users.py", line 235, in han=
dle
page =3D self.getpage(pathwords, session, argdict)
File "/usr/lib/python2.5/site-packages/Pootle/pootle.py", line 429, in ge=
tpage
return indexpage.ProjectIndex(project, session, argdict)
File "/usr/lib/python2.5/site-packages/Pootle/indexpage.py", line 353, in=
__init__
childitems =3D self.getchilditems(dirfilter)
File "/usr/lib/python2.5/site-packages/Pootle/indexpage.py", line 581, in=
getchilditems
fileitem =3D self.getfileitem(childfile)
File "/usr/lib/python2.5/site-packages/Pootle/indexpage.py", line 752, in=
getfileitem
if versioncontrol.hasversioning(os.path.join(self.project.podir, self.d=
irname)):
File "/usr/lib/python2.5/site-packages/Pootle/versioncontrol.py", line 35=
8, in hasversioning
get_versioned_object(item)
File "/usr/lib/python2.5/site-packages/Pootle/versioncontrol.py", line 33=
4, in get_versioned_object
return vers_sys(location)
File "/usr/lib/python2.5/site-packages/Pootle/versioncontrol.py", line 28=
4, in __init__
self.location =3D realpath_pofile.replace(basedir, 1)
TypeError: coercing to Unicode: need string or buffer, int found
> > i think it does not break cvs or svn, as they have a MARKER_DIR in each
> > directory
>=20
> I am not sure about this: if I am not wrong, then the current directory i=
s not
> predictable during "_init_". Thus we may not assume, that the current dir=
ectory
> contains a svn/cvs directory?
umm, just try started PootleServer from /root and the os.getcwd() in
GenericVersionControlSystem's __init__() says
/usr/lib/python2.5/site-packages/Pootle, so i think we can assume
> > 3) the third hunk no longer converts the file's path to absolute.
> > probably i copy&pasted this from cvs and/or svn, but newer darcs
> > versions seem to no longer handle absolute paths correctly, while older
> > versions are working with relative paths, too (we always call darcs from
> > the project root so this is not a big issue)
>=20
> Are you sure, that we always call darcs from the project root? I do not s=
ee
> this in the code. Did I miss something?
i just added a few "print os.getcwd()" to debug the code ans see that we
do so, at least now i tried to several actions and i was not able to
call darcs not from the project root
> I am in no way familiar with darcs, but maybe we would need to add '--rep=
odir'
> to all 'darcs' calls? Maybe you could describe, how the arguments are tre=
ated,
> when you use a --repodir? Relative to the current directory or relative t=
o the
> repodir?
i never used --repodir, but as far as i see it's relative to the repodir
> PS: the currently attached patch is a little bit clumsy. I would improve =
it
> later, but first I would like to know, if it solves any problems :)
sure, that's not a problem :)
i haven't checked deeply what's the problem with it because i don't see
exactly what's the problem with my patch which works here :)
two notes:
1) i know that i assume something that is not explicitly coded (we call
darcs from the pootle root), but i think it's still true
2) currently an scm is enabled if the marked dir is found in the
/po/project/lang dir _and_ in the / dir, while my patch checks only the
/ dir. this obviously fixes the darcs behaviour while i'm not sure how
this can cause problems with cvs/svn :)
once it works again, then of course we could improve it so that it could
find the _darcs dir not only in the pootle root
thanks,
- VMiklos
|