[PATCH 3 of 3] Test *_ISLINK merge environment vars
Patrick Mezard
pmezard at gmail.com
Thu Oct 4 22:55:44 UTC 2007
# HG changeset patch
# User Patrick Mezard <pmezard at gmail.com>
# Date 1191537047 -7200
# Node ID d2a3582c1c44f5ff6001cd34c2996407d63fde4b
# Parent 51655b6b134e2bb19ba75e65e6bdc82108a563bb
Test *_ISLINK merge environment vars
diff --git a/tests/test-merge-symlinks b/tests/test-merge-symlinks
new file mode 100755
--- /dev/null
+++ b/tests/test-merge-symlinks
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+"$TESTDIR/hghave" symlink || exit 80
+
+cat > echo.py <<EOF
+#!/usr/bin/env python
+import os
+for k in ('HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
+ print k, os.environ[k]
+EOF
+chmod +x echo.py
+
+# Create 2 heads containing the same file, once as
+# a file, once as a link.
+echo % create heads
+hg init t
+cd t
+echo a > a
+hg ci -qAm t0
+echo l > l
+hg ci -qAm t1
+hg up -C 0
+ln -s a l
+hg ci -qAm t2
+
+# Merge them and display *_ISLINK vars
+echo % merge heads
+HGMERGE=../echo.py hg merge
diff --git a/tests/test-merge-symlinks.out b/tests/test-merge-symlinks.out
new file mode 100644
--- /dev/null
+++ b/tests/test-merge-symlinks.out
@@ -0,0 +1,9 @@
+% create heads
+0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+% merge heads
+HG_MY_ISLINK 1
+HG_OTHER_ISLINK 0
+HG_BASE_ISLINK 0
+merging l
+0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
More information about the Mercurial-devel
mailing list