Mercurial > hg
comparison mercurial/localrepo.py @ 11711:a2d45964f60c
merge crew and main
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Sat, 31 Jul 2010 11:05:11 +0900 |
parents | eb07fbc21e9c |
children | 01778673aab7 |
comparison
equal
deleted
inserted
replaced
11697:efcdf6a953a0 | 11711:a2d45964f60c |
---|---|
508 return self.wopener(f, mode) | 508 return self.wopener(f, mode) |
509 | 509 |
510 def _link(self, f): | 510 def _link(self, f): |
511 return os.path.islink(self.wjoin(f)) | 511 return os.path.islink(self.wjoin(f)) |
512 | 512 |
513 def _filter(self, filter, filename, data): | 513 def _loadfilter(self, filter): |
514 if filter not in self.filterpats: | 514 if filter not in self.filterpats: |
515 l = [] | 515 l = [] |
516 for pat, cmd in self.ui.configitems(filter): | 516 for pat, cmd in self.ui.configitems(filter): |
517 if cmd == '!': | 517 if cmd == '!': |
518 continue | 518 continue |
530 if not inspect.getargspec(fn)[2]: | 530 if not inspect.getargspec(fn)[2]: |
531 oldfn = fn | 531 oldfn = fn |
532 fn = lambda s, c, **kwargs: oldfn(s, c) | 532 fn = lambda s, c, **kwargs: oldfn(s, c) |
533 l.append((mf, fn, params)) | 533 l.append((mf, fn, params)) |
534 self.filterpats[filter] = l | 534 self.filterpats[filter] = l |
535 | |
536 def _filter(self, filter, filename, data): | |
537 self._loadfilter(filter) | |
535 | 538 |
536 for mf, fn, cmd in self.filterpats[filter]: | 539 for mf, fn, cmd in self.filterpats[filter]: |
537 if mf(filename): | 540 if mf(filename): |
538 self.ui.debug("filtering %s through %s\n" % (filename, cmd)) | 541 self.ui.debug("filtering %s through %s\n" % (filename, cmd)) |
539 data = fn(data, cmd, ui=self.ui, repo=self, filename=filename) | 542 data = fn(data, cmd, ui=self.ui, repo=self, filename=filename) |
1057 if parentworking and cmp: | 1060 if parentworking and cmp: |
1058 fixup = [] | 1061 fixup = [] |
1059 # do a full compare of any files that might have changed | 1062 # do a full compare of any files that might have changed |
1060 for f in sorted(cmp): | 1063 for f in sorted(cmp): |
1061 if (f not in ctx1 or ctx2.flags(f) != ctx1.flags(f) | 1064 if (f not in ctx1 or ctx2.flags(f) != ctx1.flags(f) |
1062 or ctx1[f].cmp(ctx2[f].data())): | 1065 or ctx1[f].cmp(ctx2[f])): |
1063 modified.append(f) | 1066 modified.append(f) |
1064 else: | 1067 else: |
1065 fixup.append(f) | 1068 fixup.append(f) |
1066 | 1069 |
1067 # update dirstate for files that are actually clean | 1070 # update dirstate for files that are actually clean |
1101 modified, added, clean = [], [], [] | 1104 modified, added, clean = [], [], [] |
1102 for fn in mf2: | 1105 for fn in mf2: |
1103 if fn in mf1: | 1106 if fn in mf1: |
1104 if (mf1.flags(fn) != mf2.flags(fn) or | 1107 if (mf1.flags(fn) != mf2.flags(fn) or |
1105 (mf1[fn] != mf2[fn] and | 1108 (mf1[fn] != mf2[fn] and |
1106 (mf2[fn] or ctx1[fn].cmp(ctx2[fn].data())))): | 1109 (mf2[fn] or ctx1[fn].cmp(ctx2[fn])))): |
1107 modified.append(fn) | 1110 modified.append(fn) |
1108 elif listclean: | 1111 elif listclean: |
1109 clean.append(fn) | 1112 clean.append(fn) |
1110 del mf1[fn] | 1113 del mf1[fn] |
1111 else: | 1114 else: |