Commits

Markus Zapke-Gründemann committed f1dcab3

Tests for symlinks are only executed if this feature is available.

  • Participants
  • Parent commits 698a24d

Comments (0)

Files changed (3)

 *.pyc
 *.t.err
 *.swp
+hghave
 run-tests.py
 dist
 pylintrc

File test-importfs-symlinks.t

+These tests only work with Operating Systems which support symlinks!
+
+  $ "$TESTDIR/hghave" symlink || exit 80
+
+Load the extension:
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "importfs = $TESTDIR/importfs.py" >> $HGRCPATH
+
+Create a simple filesystem structure for import containing symlinks:
+
+  $ mkdir d1
+  $ echo "c1" > d1/f1
+  $ echo "c2" > d1/f2
+  $ mkdir d1/d2
+  $ echo "c3" > d1/d2/f3
+  $ echo "c4" > d1/d2/f4
+  $ mkdir d1/d3
+  $ cd d1
+  $ ln -s d2 d4
+  $ cd d3
+  $ ln -s ../f1 f5
+  $ cd ../..
+
+Perform an import:
+
+  $ hg importfs r1 d1
+  created repository $TESTTMP/r1
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  adding d2/f3
+  adding d2/f4
+  adding d3/f5
+  adding d4
+  adding f1
+  adding f2
+
+Take a look a the source and the repository and see if the symlinks were not
+dereferenced:
+
+  $ ls -1F d1
+  d2/
+  d3/
+  d4@
+  f1
+  f2
+  $ ls -1F r1
+  d2/
+  d3/
+  d4@
+  f1
+  f2
+  $ ls -1F d1/d3
+  f5@
+  $ ls -1F r1/d3
+  f5@