[PATCH 0 of 3] Case folding changes (repost)

Adrian Buehlmann adrian at cadifra.com
Tue Jun 3 17:44:48 CDT 2008


On 03.06.2008 18:55, Paul Moore wrote:
> This is a repost of my case folding changes, as requested by Adrian Buehlman.
> I believe all the requested changes have now been made, so I'm hoping it's
> ready for inclusion in crew :-)
> 
> This patch series adds support for case folding filesystems. It comes in 3
> parts - a dirstate method to check if the working directory is on a
> case-folding filesystem, a util function to convert a filename to the case
> stored in the filesystem, and a method on the dirstate to "normalize" a
> pathname, which is used in the dirstate.statwalk function.
> 
> Combined, these patches fix issues 910 and 1092, and implement infrastructure
> to allow fixing of further case sensitivity bugs.

Hmmm. I've applied the series to 37eedb1a1848 (crew tip)

I do get a traceback on hg rename on Windows:

> hg init

> echo jkaldkalkdfj >a

> hg add
adding a

> hg ci -m1

> hgt rename a xx
--- running hg from W:\hg-crew-paul
** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial at selenic.com
** Mercurial Distributed SCM (version ba423265f9e2)
Traceback (most recent call last):
  File "W:\hg-crew-paul\hg", line 20, in <module>
    mercurial.dispatch.run()
  File "W:\hg-crew-paul\mercurial\dispatch.py", line 20, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "W:\hg-crew-paul\mercurial\dispatch.py", line 29, in dispatch
    return _runcatch(u, args)
  File "W:\hg-crew-paul\mercurial\dispatch.py", line 45, in _runcatch
    return _dispatch(ui, args)
  File "W:\hg-crew-paul\mercurial\dispatch.py", line 364, in _dispatch
    ret = _runcommand(ui, options, cmd, d)
  File "W:\hg-crew-paul\mercurial\dispatch.py", line 417, in _runcommand
    return checkargs()
  File "W:\hg-crew-paul\mercurial\dispatch.py", line 373, in checkargs
    return cmdfunc()
  File "W:\hg-crew-paul\mercurial\dispatch.py", line 356, in <lambda>
    d = lambda: func(ui, repo, *args, **cmdoptions)
  File "W:\hg-crew-paul\mercurial\commands.py", line 2243, in rename
    return cmdutil.copy(ui, repo, pats, opts, rename=True)
  File "W:\hg-crew-paul\mercurial\cmdutil.py", line 494, in copy
    srcs = walkpat(pat)
  File "W:\hg-crew-paul\mercurial\cmdutil.py", line 324, in walkpat
    rel = m.rel(abs)
  File "W:\hg-crew-paul\mercurial\match.py", line 25, in rel
    return util.pathto(self._root, self._cwd, f)
  File "W:\hg-crew-paul\mercurial\util.py", line 352, in pathto
    if not n1: return localpath(n2)
  File "W:\hg-crew-paul\mercurial\util.py", line 1083, in localpath
    return path.replace('/', '\\')
AttributeError: 'tuple' object has no attribute 'replace'

Did I do something stupid?

BTW I can confirm that the patch series fixes issue1092 on Windows XP SP3

BTW2: the testsuite ran fine again on FreeBSD (tested ba423265f9e2)

> cd
W:\hg-crew-paul

> hg log -l4
6648[tip]   ba423265f9e2   2008-05-24 12:47 +0100   p
  Add a normalize() method to dirstate

6647   2bd76e52e5f2   2008-05-21 22:48 +0100   p
  Add a new function, fspath

6646   d9565a442354   2008-05-20 10:25 +0100   p
  Add a folding() method to dirstate

6645   37eedb1a1848   2008-06-03 09:34 +0200   dirkjan
  mq: introduce the qfinish command

> python -V
Python 2.5.1


Some additional, unrelated problem I noticed:

For some yet unknown reason, hg import (also qimport) fails to
correctly import patch3 on Windows XP SP3. I get a different cset id
(6a4ace364599) than the one I get if I import the patches on FreeBSD
(ba423265f9e2). The diff for 6a4ace364599 on Windows shows 2 removed
empty lines that are not in the patch. I've saved the patches to three
files having LF line ends. Used those exact same files on both FreeBSD
and on Windows for import. hg versions tested on Windows: 37eedb1a1848
and 626cb86a6523+tortoisehg (both produce the same result).
As a workaround, I did a hg serve on my FreeBSD box and pulled the
csets to my Windows box.
I will try to investigate this Windows import problem further tomorrow
morning.



More information about the Mercurial-devel mailing list