Show More
@@ -378,13 +378,14 b' class workingctx(changectx):' | |||||
378 | """generate a manifest corresponding to the working directory""" |
|
378 | """generate a manifest corresponding to the working directory""" | |
379 |
|
379 | |||
380 | man = self._parents[0].manifest().copy() |
|
380 | man = self._parents[0].manifest().copy() | |
|
381 | is_exec = util.execfunc(self._repo.root, man.execf) | |||
381 | copied = self._repo.dirstate.copies() |
|
382 | copied = self._repo.dirstate.copies() | |
382 | modified, added, removed, deleted, unknown = self._status[:5] |
|
383 | modified, added, removed, deleted, unknown = self._status[:5] | |
383 | for i, l in (("a", added), ("m", modified), ("u", unknown)): |
|
384 | for i, l in (("a", added), ("m", modified), ("u", unknown)): | |
384 | for f in l: |
|
385 | for f in l: | |
385 | man[f] = man.get(copied.get(f, f), nullid) + i |
|
386 | man[f] = man.get(copied.get(f, f), nullid) + i | |
386 | try: |
|
387 | try: | |
387 |
man.set(f, |
|
388 | man.set(f, is_exec(f)) | |
388 | except OSError: |
|
389 | except OSError: | |
389 | pass |
|
390 | pass | |
390 |
|
391 |
@@ -712,11 +712,12 b' class localrepository(repo.repository):' | |||||
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, |
|
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) | |
@@ -877,9 +878,10 b' class localrepository(repo.repository):' | |||||
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, |
|
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] |
@@ -524,6 +524,7 b' def diff(repo, node1=None, node2=None, f' | |||||
524 | all = modified + added + removed |
|
524 | all = modified + added + removed | |
525 | all.sort() |
|
525 | all.sort() | |
526 | gone = {} |
|
526 | gone = {} | |
|
527 | ||||
527 | for f in all: |
|
528 | for f in all: | |
528 | to = None |
|
529 | to = None | |
529 | tn = None |
|
530 | tn = None |
@@ -707,6 +707,12 b' def checkexec(path):' | |||||
707 | os.unlink(fn) |
|
707 | os.unlink(fn) | |
708 | return r |
|
708 | return r | |
709 |
|
709 | |||
|
710 | def execfunc(path, fallback): | |||
|
711 | '''return an is_exec() function with default to fallback''' | |||
|
712 | if checkexec(path): | |||
|
713 | return lambda x: is_exec(os.path.join(path, x), False) | |||
|
714 | return fallback | |||
|
715 | ||||
710 | # Platform specific variants |
|
716 | # Platform specific variants | |
711 | if os.name == 'nt': |
|
717 | if os.name == 'nt': | |
712 | import msvcrt |
|
718 | import msvcrt |
General Comments 0
You need to be logged in to leave comments.
Login now