[PATCH 1 of 2 STABLE] revlog: if start is nullrev, end is always a descendant

Nicolas Dumazet nicdumz at gmail.com
Sun Nov 7 06:06:41 CST 2010


# HG changeset patch
# User Nicolas Dumazet <nicdumz.commits at gmail.com>
# Date 1289121367 -32400
# Branch stable
# Node ID eef3494b814709d36f7ba25cdb4b127701552856
# Parent  ea7ad8c3988aa27266b24b3cc1a52bcdcb91b0e0
revlog: if start is nullrev, end is always a descendant

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -869,6 +869,8 @@
         return c
 
     def descendant(self, start, end):
+        if start == nullrev:
+            return True
         for i in self.descendants(start):
             if i == end:
                 return True
diff --git a/tests/test-no-symlinks b/tests/test-no-symlinks
deleted file mode 100755
--- a/tests/test-no-symlinks
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" no-symlink || exit 80
-
-# The following script was used to create the bundle:
-#
-# hg init symlinks
-# cd symlinks
-# echo a > a
-# mkdir d
-# echo b > d/b
-# ln -s a a.lnk
-# ln -s d/b d/b.lnk
-# hg ci -Am t
-# hg bundle --base null ../test-no-symlinks.hg
-
-# Extract a symlink on a platform not supporting them
-echo % unbundle
-hg init t
-cd t
-hg pull -q "$TESTDIR/test-no-symlinks.hg"
-hg update
-
-cat a.lnk && echo
-cat d/b.lnk && echo
-
-# Copy a symlink and move another
-echo % move and copy
-hg copy a.lnk d/a2.lnk
-hg mv d/b.lnk b2.lnk
-hg ci -Am copy
-cat d/a2.lnk && echo
-cat b2.lnk && echo
-
-# Bundle and extract again
-echo % bundle
-hg bundle --base null ../symlinks.hg
-cd ..
-
-hg init t2
-cd t2
-hg pull ../symlinks.hg
-hg update
-
-cat a.lnk && echo
-cat d/a2.lnk && echo
-cat b2.lnk && echo


More information about the Mercurial-devel mailing list