Commit Graph

23 Commits

Author SHA1 Message Date
Bryan O'Sullivan
c4e1eeb2a3 store: switch to C-based hashed path encoding 2012-12-12 13:09:37 -08:00
Adrian Buehlmann
6e3cf264c2 test-hybridencode: in practice, extensions aren't really unbound in length
due to the fact that we only get to encode files ending in .i and .d inside
the store
2012-09-30 23:53:56 +02:00
Adrian Buehlmann
6b92842dc4 test-hybridencode: use store._dothybridencode(s)
and compare it with the result of store._hybridencode(s, True)
2012-09-19 11:39:18 +02:00
Bryan O'Sullivan
3a8cc26af7 tests: run test-hybridencode.py over both Python and C encoders
This ensures that the two always give the same answers.
2012-09-18 16:09:02 -07:00
Adrian Buehlmann
b335701920 test-hybridencode: add a case for direncode 2012-09-16 22:43:24 +02:00
Adrian Buehlmann
e773964ca6 store: eliminate one level of lambda functions on _hybridencode 2012-09-16 11:36:14 +02:00
Adrian Buehlmann
24b5ea2ece test-hybridencode: a few more cases 2012-09-13 17:46:34 +02:00
Adrian Buehlmann
376af2d3bd test-hybridencode: extensions are replicated on hashed paths
unfortunately, this is done unbounded, so the length of the hashed path
is not really limited
2012-09-06 22:51:32 +02:00
Adrian Buehlmann
dc86f4b8fe test-hybridencode: dropping dir eight in hashed path due to dot or space at end 2012-09-06 19:53:23 +02:00
Adrian Buehlmann
b21f00c3ed test-hybridencode: adding one truncated char to dir 1..7 won't drop dir 8 2012-09-06 15:53:59 +02:00
Adrian Buehlmann
7ce442025b test-hybridencode: testing dir levels and dir prefix lenghts of hashed paths 2012-09-06 15:04:07 +02:00
Adrian Buehlmann
8b095919bb test-hybridencode: test full range of ASCII codes from 126 to 255 2012-09-05 14:08:31 +02:00
Adrian Buehlmann
db33974023 test-hybridencode: remove x00 character case
precludes implementation in C
2012-09-05 13:57:58 +02:00
Adrian Buehlmann
bd0d6c8bb8 test-hybridencode: add more testcases for hashed paths 2012-08-31 13:08:11 +02:00
Adrian Buehlmann
0c7d47779b test-hybridencode: more testcases 2012-08-29 11:48:36 +02:00
Adrian Buehlmann
6144d7a1ba test-hybridencode: add cases for com0..9 and lpt0..9
note that com0 and lpt0 are *not* encoded
2012-08-28 20:57:11 +02:00
Dan Villiom Podlaski Christiansen
f385faac7a *: kill all unnecessary shebangs. 2010-10-26 12:18:39 +02:00
Adrian Buehlmann
04f7530508 store: encode first period or space in filenames (issue1713)
- Mac OS X has problems with filenames starting with '._'
  (e.g. '.FOO' -> '._f_o_o' is now encoded as '~2e_f_o_o')

- Explorer of Windows Vista and Windows 7 strip leading spaces of
  path elements of filenames when copying trees

Above problems are avoided by encoding the first space (as '~20') or
period (as '~2e') of all path elements.

This introduces a new entry 'dotencode' in .hg/requires, that is,
a new repository filename layout (inside .hg/store).

Newly created repositories require 'dotencode' by default. Specifying

  [format]
  dotencode = False

in a config file will use the old format instead.

Prior Mercurial versions will abort with the message

   abort: requirement 'dotencode' not supported!

when trying to access a local repository that requires 'dotencode'.

New 'dotencode' repositories can be converted to the previous
repository format with

  hg --config format.dotencode=0 clone --pull repoA repoB
2010-10-09 21:54:50 +02:00
Martin Geisler
37b00fb404 test-hybridencode: break long string literals 2009-05-31 01:13:45 +02:00
Martin Geisler
aedc0ac57f tests: removed unnecessary execute bit on Python tests 2009-05-17 01:42:21 +02:00
Adrian Buehlmann
b2991e8893 store: encode trailing period and space on directory names (issue1417)
Windows won't create directories with names ending in period or space, so
we encode the last period/space character in directory names of non-hashed
paths in the store using reversible ~xx encoding (' ' -> '~20', '.' -> '~2e').

With this change it is possible to remove a directory ending in period or space
that was inadvertantly checked in on a linux system while still being able
to clone such a repository with its full history to Windows (see also issue793).
2008-12-13 18:32:29 +01:00
Adrian Buehlmann
9a0526b2cd store: don't create dirs ending in period or space for hashed paths (issue1417)
Windows won't create directories with names ending in period or space, so
we replace the last period/space character in truncated directory names of
hashed paths with some other character (underbar).
2008-12-13 17:39:56 +01:00
Adrian Buehlmann
c550091c36 add new test-hybridencode.py 2008-10-27 19:39:41 +01:00