comparison mercurial/localrepo.py @ 3996:c190df14338c

exec: add execfunc to simplify exec flag support on non-exec filesystems
author Matt Mackall <mpm@selenic.com>
date Fri, 29 Dec 2006 20:04:30 -0600
parents 497c69726a04
children d7b9ec589546
comparison
equal deleted inserted replaced
3995:a4e79f86d304 3996:c190df14338c
710 710
711 # check in files 711 # check in files
712 new = {} 712 new = {}
713 linkrev = self.changelog.count() 713 linkrev = self.changelog.count()
714 commit.sort() 714 commit.sort()
715 is_exec = util.execfunc(self.root, m1.execf)
715 for f in commit: 716 for f in commit:
716 self.ui.note(f + "\n") 717 self.ui.note(f + "\n")
717 try: 718 try:
718 new[f] = self.filecommit(f, m1, m2, linkrev, tr, changed) 719 new[f] = self.filecommit(f, m1, m2, linkrev, tr, changed)
719 m1.set(f, util.is_exec(self.wjoin(f), m1.execf(f))) 720 m1.set(f, is_exec(f))
720 except IOError: 721 except IOError:
721 if use_dirstate: 722 if use_dirstate:
722 self.ui.warn(_("trouble committing %s!\n") % f) 723 self.ui.warn(_("trouble committing %s!\n") % f)
723 raise 724 raise
724 else: 725 else:
875 else: 876 else:
876 # we are comparing working dir against non-parent 877 # we are comparing working dir against non-parent
877 # generate a pseudo-manifest for the working dir 878 # generate a pseudo-manifest for the working dir
878 # XXX: create it in dirstate.py ? 879 # XXX: create it in dirstate.py ?
879 mf2 = mfmatches(self.dirstate.parents()[0]) 880 mf2 = mfmatches(self.dirstate.parents()[0])
881 is_exec = util.execfunc(self.root, mf2.execf)
880 for f in lookup + modified + added: 882 for f in lookup + modified + added:
881 mf2[f] = "" 883 mf2[f] = ""
882 mf2.set(f, execf=util.is_exec(self.wjoin(f), mf2.execf(f))) 884 mf2.set(f, is_exec(f))
883 for f in removed: 885 for f in removed:
884 if f in mf2: 886 if f in mf2:
885 del mf2[f] 887 del mf2[f]
886 else: 888 else:
887 # we are comparing two revisions 889 # we are comparing two revisions