tests/test-known.t
author Matt Mackall <mpm@selenic.com>
Tue, 22 Nov 2011 17:26:32 -0600
branchstable
changeset 15551 1fa41d1f1351
parent 13723 e615765fdcc7
child 15446 c5c9ca3719f9
permissions -rw-r--r--
posix: add extended support for OS X path folding OS X does the following transformation on paths for comparisons: a) 8-bit strings are decoded as UTF-8 to UTF-16 b) undecodable bytes are percent-escaped c) accented characters are converted to NFD decomposed form, approximately d) characters are converted to _lowercase_ using internal tables Both (c) and (d) are done using internal tables that vary from release to release and match Unicode specs to greater or lesser extent. We approximate these functions using Python's internal Unicode data. With this change, Mercurial will (in almost all cases) match OS X folding and not report unknown file aliases for files in UTF-8 or other encodings.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13723
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
     1
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
     2
= Test the known() protocol function =
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
     3
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
     4
Create a test repository:
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
     5
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
     6
  $ hg init repo
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
     7
  $ cd repo
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
     8
  $ touch a ; hg add a ; hg ci -ma
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
     9
  $ touch b ; hg add b ; hg ci -mb
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    10
  $ touch c ; hg add c ; hg ci -mc
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    11
  $ hg log --template '{node}\n'
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    12
  991a3460af53952d10ec8a295d3d2cc2e5fa9690
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    13
  0e067c57feba1a5694ca4844f05588bb1bf82342
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    14
  3903775176ed42b1458a6281db4a0ccf4d9f287a
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    15
  $ cd ..
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    16
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    17
Test locally:
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    18
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    19
  $ hg debugknown repo 991a3460af53952d10ec8a295d3d2cc2e5fa9690 0e067c57feba1a5694ca4844f05588bb1bf82342 3903775176ed42b1458a6281db4a0ccf4d9f287a
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    20
  111
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    21
  $ hg debugknown repo 000a3460af53952d10ec8a295d3d2cc2e5fa9690 0e067c57feba1a5694ca4844f05588bb1bf82342 0003775176ed42b1458a6281db4a0ccf4d9f287a
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    22
  010
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    23
  $ hg debugknown repo
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    24
  
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    25
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    26
Test via HTTP:
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    27
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    28
  $ hg serve -R repo -p $HGPORT -d --pid-file=hg.pid -E error.log -A access.log
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    29
  $ cat hg.pid >> $DAEMON_PIDS
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    30
  $ hg debugknown http://localhost:$HGPORT/ 991a3460af53952d10ec8a295d3d2cc2e5fa9690 0e067c57feba1a5694ca4844f05588bb1bf82342 3903775176ed42b1458a6281db4a0ccf4d9f287a
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    31
  111
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    32
  $ hg debugknown http://localhost:$HGPORT/ 000a3460af53952d10ec8a295d3d2cc2e5fa9690 0e067c57feba1a5694ca4844f05588bb1bf82342 0003775176ed42b1458a6281db4a0ccf4d9f287a
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    33
  010
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    34
  $ hg debugknown http://localhost:$HGPORT/
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    35
  
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    36
  $ cat error.log
e615765fdcc7 wireproto: add known([id]) function
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    37