Test *_ISLINK merge environment vars
authorPatrick Mezard <pmezard@gmail.com>
Fri, 05 Oct 2007 23:01:38 +0200
changeset 5391 786c1206a029
parent 5390 36c46e20976a
child 5392 66d7aabf5b41
Test *_ISLINK merge environment vars
tests/test-merge-symlinks
tests/test-merge-symlinks.out
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-symlinks	Fri Oct 05 23:01:38 2007 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-symlinks.out	Fri Oct 05 23:01:38 2007 +0200
@@ -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)