##// END OF EJS Templates
symlinks: use is_link wherever is_exec is used
Matt Mackall -
r4002:d7b9ec58 default
parent child Browse files
Show More
@@ -379,13 +379,14 b' class workingctx(changectx):'
379 379
380 380 man = self._parents[0].manifest().copy()
381 381 is_exec = util.execfunc(self._repo.root, man.execf)
382 is_link = util.linkfunc(self._repo.root, man.linkf)
382 383 copied = self._repo.dirstate.copies()
383 384 modified, added, removed, deleted, unknown = self._status[:5]
384 385 for i, l in (("a", added), ("m", modified), ("u", unknown)):
385 386 for f in l:
386 387 man[f] = man.get(copied.get(f, f), nullid) + i
387 388 try:
388 man.set(f, is_exec(f))
389 man.set(f, is_exec(f), is_link(f))
389 390 except OSError:
390 391 pass
391 392
@@ -713,11 +713,12 b' class localrepository(repo.repository):'
713 713 linkrev = self.changelog.count()
714 714 commit.sort()
715 715 is_exec = util.execfunc(self.root, m1.execf)
716 is_link = util.linkfunc(self.root, m1.linkf)
716 717 for f in commit:
717 718 self.ui.note(f + "\n")
718 719 try:
719 720 new[f] = self.filecommit(f, m1, m2, linkrev, tr, changed)
720 m1.set(f, is_exec(f))
721 m1.set(f, is_exec(f), is_link(f))
721 722 except IOError:
722 723 if use_dirstate:
723 724 self.ui.warn(_("trouble committing %s!\n") % f)
@@ -879,9 +880,10 b' class localrepository(repo.repository):'
879 880 # XXX: create it in dirstate.py ?
880 881 mf2 = mfmatches(self.dirstate.parents()[0])
881 882 is_exec = util.execfunc(self.root, mf2.execf)
883 is_link = util.linkfunc(self.root, mf2.linkf)
882 884 for f in lookup + modified + added:
883 885 mf2[f] = ""
884 mf2.set(f, is_exec(f))
886 mf2.set(f, is_exec(f), is_link(f))
885 887 for f in removed:
886 888 if f in mf2:
887 889 del mf2[f]
@@ -713,7 +713,7 b' def execfunc(path, fallback):'
713 713 return lambda x: is_exec(os.path.join(path, x))
714 714 return fallback
715 715
716 def checksymlink(path):
716 def checklink(path):
717 717 """check whether the given path is on a symlink-capable filesystem"""
718 718 # mktemp is not racy because symlink creation will fail if the
719 719 # file already exists
@@ -21,8 +21,7 b' abort: no match under directory .../test'
21 21 dir/file
22 22 does-not-exist: No such file or directory
23 23 abort: file .../test/does-not-exist not found!
24 baz: unsupported file type (type is symbolic link)
25 abort: can't commit .../test/baz: unsupported file type!
24 abort: file .../test/baz not tracked!
26 25 abort: file .../test/quux not tracked!
27 26 dir/file
28 27 % partial subdir commit test
@@ -1,11 +1,12 b''
1 adding bar
1 2 adding foo
2 3 adding bomb
3 4 adding a.c
4 5 adding dir/a.o
5 6 adding dir/b.o
7 M dir/b.o
6 8 ! a.c
7 9 ! dir/a.o
8 ! dir/b.o
9 10 ? .hgignore
10 11 a.c: unsupported file type (type is fifo)
11 12 ! a.c
General Comments 0
You need to be logged in to leave comments. Login now