Mercurial > hg
comparison mercurial/context.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 | b4eaa68dea1b |
children | d7b9ec589546 |
comparison
equal
deleted
inserted
replaced
3995:a4e79f86d304 | 3996:c190df14338c |
---|---|
376 | 376 |
377 def _buildmanifest(self): | 377 def _buildmanifest(self): |
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, util.is_exec(self._repo.wjoin(f), man.execf(f))) | 388 man.set(f, is_exec(f)) |
388 except OSError: | 389 except OSError: |
389 pass | 390 pass |
390 | 391 |
391 for f in deleted + removed: | 392 for f in deleted + removed: |
392 if f in man: | 393 if f in man: |