Commits

Markus Zapke-Gründemann  committed aaea368

Added test regarding permissions.

  • Participants
  • Parent commits c0a4850

Comments (0)

Files changed (1)

File test-importfs-permissions.t

+Load the extension:
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "importfs = $TESTDIR/importfs.py" >> $HGRCPATH
+
+Create files and directories to import:
+
+  $ mkdir -p d1/{d2,d3}
+  $ echo c1 > d1/f1
+  $ echo c2 > d1/d2/f2
+  $ echo c3 > d1/d3/f3
+
+Remove read permissions from directory d3:
+
+  $ chmod u-r d1/d3
+
+Perform the import, fails because read permissions are denied:
+
+  $ hg importfs r1 d1
+  created repository $TESTTMP/r1
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  abort: Permission denied: d1/d3
+  [255]
+
+Import also fails if directory d3 is ignored:
+
+  $ hg importfs r1 d1 --exclude-path d1/d3
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  abort: Permission denied: d1/d3
+  [255]