[PATCH 3 of 4] test-conflicts: conditionalize for no-symlink platforms

Matt Harbison mharbison72 at gmail.com
Sat Oct 14 01:54:46 EDT 2017


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1507957679 14400
#      Sat Oct 14 01:07:59 2017 -0400
# Node ID a154d01373b495122cf6ee17dd90ee600b8d4f41
# Parent  60c022679230b586511ec1c7ebc350dbd16e99f0
test-conflicts: conditionalize for no-symlink platforms

It seems better to create standin files for the symlinks, rather than blacklist
the entire tests.  Especially since link vs file doesn't seem to affect the
tests.

There is more instability in test-pathconflicts-{basic,merge}.t that I can't
figure out.

diff --git a/tests/test-origbackup-conflict.t b/tests/test-origbackup-conflict.t
--- a/tests/test-origbackup-conflict.t
+++ b/tests/test-origbackup-conflict.t
@@ -75,13 +75,19 @@
 
   $ hg up -q 0
   $ mkdir ../sym-link-target
+#if symlink
   $ ln -s ../../../sym-link-target b
+#else
+  $ touch b
+#endif
   $ hg up b1
   b: replacing untracked file
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (activating bookmark b1)
+#if symlink
   $ readlink.py .hg/origbackups/b
   .hg/origbackups/b -> ../../../sym-link-target
+#endif
 
 Perform an update that causes b/c to be backed up again - it should not go into the target dir
 
@@ -111,7 +117,8 @@
   b/c: replacing untracked file
   getting b/c
   creating directory: $TESTTMP/repo/.hg/badorigbackups/b
-  abort: Not a directory: '$TESTTMP/repo/.hg/badorigbackups/b'
+  abort: The system cannot find the path specified: '$TESTTMP/repo/.hg/badorigbackups/b' (glob) (windows !)
+  abort: Not a directory: '$TESTTMP/repo/.hg/badorigbackups/b' (no-windows !)
   [255]
   $ cat .hg/badorigbackups
   data
diff --git a/tests/test-pathconflicts-update.t b/tests/test-pathconflicts-update.t
--- a/tests/test-pathconflicts-update.t
+++ b/tests/test-pathconflicts-update.t
@@ -15,7 +15,11 @@
   $ hg up 0
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ mkdir a
+#if symlink
   $ ln -s c a/b
+#else
+  $ touch a/b
+#endif
   $ hg add a/b
   $ hg commit -m "link"
   created new head
@@ -50,7 +54,11 @@
 
   $ hg up -q 0
   $ mkdir a
+#if symlink
   $ ln -s x a/b
+#else
+  $ touch a/b
+#endif
   $ hg up dir
   a/b: untracked file conflicts with directory
   abort: untracked files in working directory differ from files in requested revision
@@ -59,8 +67,10 @@
   a/b: replacing untracked file
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (activating bookmark dir)
+#if symlink
   $ readlink.py a/b.orig
   a/b.orig -> x
+#endif
   $ rm a/b.orig
 
 Update - local directory conflicts with remote file
@@ -94,8 +104,10 @@
   a/b: replacing untracked files in directory
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (activating bookmark link)
+#if symlink
   $ readlink.py a/b
   a/b -> c
+#endif
   $ test -d a/b.orig
   $ rm -rf a/b.orig
 


More information about the Mercurial-devel mailing list