Mercurial > hg
changeset 2069:15ec724ba351
merge with crew.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Thu, 13 Apr 2006 17:11:35 -0700 |
parents | 4a49daa3a40c (current diff) 547ede0123a2 (diff) |
children | 4bce7e8bb42b |
files | tests/run-tests |
diffstat | 5 files changed, 53 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/dirstate.py Thu Apr 13 17:11:04 2006 -0700 +++ b/mercurial/dirstate.py Thu Apr 13 17:11:35 2006 -0700 @@ -342,7 +342,16 @@ names.sort() # nd is the top of the repository dir tree nd = util.normpath(top[len(self.root) + 1:]) - if nd == '.': nd = '' + if nd == '.': + nd = '' + else: + # do not recurse into a repo contained in this + # one. use bisect to find .hg directory so speed + # is good on big directory. + hg = bisect.bisect_left(names, '.hg') + if hg < len(names) and names[hg] == '.hg': + if os.path.isdir(os.path.join(top, '.hg')): + continue for f in names: np = util.pconvert(os.path.join(nd, f)) if seen(np):
--- a/mercurial/util.py Thu Apr 13 17:11:04 2006 -0700 +++ b/mercurial/util.py Thu Apr 13 17:11:35 2006 -0700 @@ -373,8 +373,10 @@ """unlink and remove the directory if it is empty""" os.unlink(f) # try removing directories that might now be empty - try: os.removedirs(os.path.dirname(f)) - except: pass + try: + os.removedirs(os.path.dirname(f)) + except OSError: + pass def copyfiles(src, dst, hardlink=None): """Copy a directory tree using hardlinks if possible"""
--- a/tests/run-tests Thu Apr 13 17:11:04 2006 -0700 +++ b/tests/run-tests Thu Apr 13 17:11:35 2006 -0700 @@ -24,6 +24,16 @@ HGMERGE=true; export HGMERGE HGUSER="test"; export HGUSER HGRCPATH=""; export HGRCPATH +OS=`uname` + +case "$OS" in + HP-UX|SunOS) + DIFFOPTS= + ;; + *) + DIFFOPTS=-u + ;; +esac if [ `echo -n HG` = "-n HG" ] then @@ -118,13 +128,13 @@ cat "$ERR" fail=1 elif [ -r "$OUTOK" ]; then - if diff -u "$OUTOK" "$OUT" > /dev/null; then + if diff $DIFFOPTS "$OUTOK" "$OUT" > /dev/null; then : no differences else cp "$OUT" "$ERR" echo echo "$1 output changed:" - diff -u "$OUTOK" "$ERR" || true + diff $DIFFOPTS "$OUTOK" "$ERR" || true fail=1 fi fi
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-nested-repo Thu Apr 13 17:11:35 2006 -0700 @@ -0,0 +1,19 @@ +#!/bin/sh + +hg init a +cd a +hg init b +echo x > b/x +echo '# should print nothing' +hg st +echo '# should print ? b/x' +hg st b/x + +hg add b/x + +echo '# should print A b/x' +hg st +echo '# should forget b/x' +hg forget +echo '# should print nothing' +hg st b