# HG changeset patch # User Matt Mackall # Date 1167444271 21600 # Node ID d7b9ec5895467d8493e8c038b2bc5f38eed02062 # Parent dda03b2d9ef1e37f54d3868394b1f452d02551c0 symlinks: use is_link wherever is_exec is used diff -r dda03b2d9ef1 -r d7b9ec589546 mercurial/context.py --- a/mercurial/context.py Fri Dec 29 20:04:31 2006 -0600 +++ b/mercurial/context.py Fri Dec 29 20:04:31 2006 -0600 @@ -379,13 +379,14 @@ man = self._parents[0].manifest().copy() is_exec = util.execfunc(self._repo.root, man.execf) + is_link = util.linkfunc(self._repo.root, man.linkf) copied = self._repo.dirstate.copies() modified, added, removed, deleted, unknown = self._status[:5] for i, l in (("a", added), ("m", modified), ("u", unknown)): for f in l: man[f] = man.get(copied.get(f, f), nullid) + i try: - man.set(f, is_exec(f)) + man.set(f, is_exec(f), is_link(f)) except OSError: pass diff -r dda03b2d9ef1 -r d7b9ec589546 mercurial/localrepo.py --- a/mercurial/localrepo.py Fri Dec 29 20:04:31 2006 -0600 +++ b/mercurial/localrepo.py Fri Dec 29 20:04:31 2006 -0600 @@ -713,11 +713,12 @@ linkrev = self.changelog.count() commit.sort() is_exec = util.execfunc(self.root, m1.execf) + is_link = util.linkfunc(self.root, m1.linkf) for f in commit: self.ui.note(f + "\n") try: new[f] = self.filecommit(f, m1, m2, linkrev, tr, changed) - m1.set(f, is_exec(f)) + m1.set(f, is_exec(f), is_link(f)) except IOError: if use_dirstate: self.ui.warn(_("trouble committing %s!\n") % f) @@ -879,9 +880,10 @@ # XXX: create it in dirstate.py ? mf2 = mfmatches(self.dirstate.parents()[0]) is_exec = util.execfunc(self.root, mf2.execf) + is_link = util.linkfunc(self.root, mf2.linkf) for f in lookup + modified + added: mf2[f] = "" - mf2.set(f, is_exec(f)) + mf2.set(f, is_exec(f), is_link(f)) for f in removed: if f in mf2: del mf2[f] diff -r dda03b2d9ef1 -r d7b9ec589546 mercurial/util.py --- a/mercurial/util.py Fri Dec 29 20:04:31 2006 -0600 +++ b/mercurial/util.py Fri Dec 29 20:04:31 2006 -0600 @@ -713,7 +713,7 @@ return lambda x: is_exec(os.path.join(path, x)) return fallback -def checksymlink(path): +def checklink(path): """check whether the given path is on a symlink-capable filesystem""" # mktemp is not racy because symlink creation will fail if the # file already exists diff -r dda03b2d9ef1 -r d7b9ec589546 tests/test-commit.out --- a/tests/test-commit.out Fri Dec 29 20:04:31 2006 -0600 +++ b/tests/test-commit.out Fri Dec 29 20:04:31 2006 -0600 @@ -21,8 +21,7 @@ dir/file does-not-exist: No such file or directory abort: file .../test/does-not-exist not found! -baz: unsupported file type (type is symbolic link) -abort: can't commit .../test/baz: unsupported file type! +abort: file .../test/baz not tracked! abort: file .../test/quux not tracked! dir/file % partial subdir commit test diff -r dda03b2d9ef1 -r d7b9ec589546 tests/test-symlinks.out --- a/tests/test-symlinks.out Fri Dec 29 20:04:31 2006 -0600 +++ b/tests/test-symlinks.out Fri Dec 29 20:04:31 2006 -0600 @@ -1,11 +1,12 @@ +adding bar adding foo adding bomb adding a.c adding dir/a.o adding dir/b.o +M dir/b.o ! a.c ! dir/a.o -! dir/b.o ? .hgignore a.c: unsupported file type (type is fifo) ! a.c