Show More
@@ -115,8 +115,8 b' def walkchangerevs(ui, repo, pats, opts)' | |||||
115 | yield rev |
|
115 | yield rev | |
116 |
|
116 | |||
117 | minrev, maxrev = min(revs), max(revs) |
|
117 | minrev, maxrev = min(revs), max(revs) | |
118 | for file in files: |
|
118 | for file_ in files: | |
119 | filelog = repo.file(file) |
|
119 | filelog = repo.file(file_) | |
120 | # A zero count may be a directory or deleted file, so |
|
120 | # A zero count may be a directory or deleted file, so | |
121 | # try to find matching entries on the slow path. |
|
121 | # try to find matching entries on the slow path. | |
122 | if filelog.count() == 0: |
|
122 | if filelog.count() == 0: | |
@@ -127,7 +127,7 b' def walkchangerevs(ui, repo, pats, opts)' | |||||
127 | if rev < minrev: |
|
127 | if rev < minrev: | |
128 | break |
|
128 | break | |
129 | fncache.setdefault(rev, []) |
|
129 | fncache.setdefault(rev, []) | |
130 | fncache[rev].append(file) |
|
130 | fncache[rev].append(file_) | |
131 | wanted[rev] = 1 |
|
131 | wanted[rev] = 1 | |
132 | if slowpath: |
|
132 | if slowpath: | |
133 | # The slow path checks files modified in every changeset. |
|
133 | # The slow path checks files modified in every changeset. | |
@@ -447,7 +447,6 b' def help_(ui, cmd=None, with_version=Fal' | |||||
447 | f = f.lstrip("^") |
|
447 | f = f.lstrip("^") | |
448 | if not ui.debugflag and f.startswith("debug"): |
|
448 | if not ui.debugflag and f.startswith("debug"): | |
449 | continue |
|
449 | continue | |
450 | d = "" |
|
|||
451 | doc = e[0].__doc__ |
|
450 | doc = e[0].__doc__ | |
452 | if not doc: |
|
451 | if not doc: | |
453 | doc = _("(No help text available)") |
|
452 | doc = _("(No help text available)") | |
@@ -1290,6 +1289,7 b' def grep(ui, repo, pattern, *pats, **opt' | |||||
1290 | s = linestate(line, lnum, cstart, cend) |
|
1289 | s = linestate(line, lnum, cstart, cend) | |
1291 | m[s] = s |
|
1290 | m[s] = s | |
1292 |
|
1291 | |||
|
1292 | # FIXME: prev isn't used, why ? | |||
1293 | prev = {} |
|
1293 | prev = {} | |
1294 | ucache = {} |
|
1294 | ucache = {} | |
1295 | def display(fn, rev, states, prevstates): |
|
1295 | def display(fn, rev, states, prevstates): |
@@ -270,11 +270,11 b' class dirstate(object):' | |||||
270 | elif not dc: |
|
270 | elif not dc: | |
271 | dc = self.filterfiles(files) |
|
271 | dc = self.filterfiles(files) | |
272 |
|
272 | |||
273 | def statmatch(file, stat): |
|
273 | def statmatch(file_, stat): | |
274 | file = util.pconvert(file) |
|
274 | file_ = util.pconvert(file_) | |
275 | if file not in dc and self.ignore(file): |
|
275 | if file_ not in dc and self.ignore(file_): | |
276 | return False |
|
276 | return False | |
277 | return match(file) |
|
277 | return match(file_) | |
278 |
|
278 | |||
279 | return self.walkhelper(files=files, statmatch=statmatch, dc=dc) |
|
279 | return self.walkhelper(files=files, statmatch=statmatch, dc=dc) | |
280 |
|
280 | |||
@@ -350,9 +350,9 b' class dirstate(object):' | |||||
350 | continue |
|
350 | continue | |
351 | if stat.S_ISDIR(st.st_mode): |
|
351 | if stat.S_ISDIR(st.st_mode): | |
352 | cmp1 = (lambda x, y: cmp(x[1], y[1])) |
|
352 | cmp1 = (lambda x, y: cmp(x[1], y[1])) | |
353 | sorted = [ x for x in findfiles(f) ] |
|
353 | sorted_ = [ x for x in findfiles(f) ] | |
354 | sorted.sort(cmp1) |
|
354 | sorted_.sort(cmp1) | |
355 | for e in sorted: |
|
355 | for e in sorted_: | |
356 | yield e |
|
356 | yield e | |
357 | else: |
|
357 | else: | |
358 | ff = util.normpath(ff) |
|
358 | ff = util.normpath(ff) | |
@@ -380,7 +380,7 b' class dirstate(object):' | |||||
380 |
|
380 | |||
381 | for src, fn, st in self.statwalk(files, match): |
|
381 | for src, fn, st in self.statwalk(files, match): | |
382 | try: |
|
382 | try: | |
383 | type, mode, size, time = self[fn] |
|
383 | type_, mode, size, time = self[fn] | |
384 | except KeyError: |
|
384 | except KeyError: | |
385 | unknown.append(fn) |
|
385 | unknown.append(fn) | |
386 | continue |
|
386 | continue | |
@@ -399,22 +399,22 b' class dirstate(object):' | |||||
399 | nonexistent = False |
|
399 | nonexistent = False | |
400 | # XXX: what to do with file no longer present in the fs |
|
400 | # XXX: what to do with file no longer present in the fs | |
401 | # who are not removed in the dirstate ? |
|
401 | # who are not removed in the dirstate ? | |
402 | if nonexistent and type in "nm": |
|
402 | if nonexistent and type_ in "nm": | |
403 | deleted.append(fn) |
|
403 | deleted.append(fn) | |
404 | continue |
|
404 | continue | |
405 | # check the common case first |
|
405 | # check the common case first | |
406 | if type == 'n': |
|
406 | if type_ == 'n': | |
407 | if not st: |
|
407 | if not st: | |
408 | st = os.stat(fn) |
|
408 | st = os.stat(fn) | |
409 | if size != st.st_size or (mode ^ st.st_mode) & 0100: |
|
409 | if size != st.st_size or (mode ^ st.st_mode) & 0100: | |
410 | modified.append(fn) |
|
410 | modified.append(fn) | |
411 | elif time != st.st_mtime: |
|
411 | elif time != st.st_mtime: | |
412 | lookup.append(fn) |
|
412 | lookup.append(fn) | |
413 | elif type == 'm': |
|
413 | elif type_ == 'm': | |
414 | modified.append(fn) |
|
414 | modified.append(fn) | |
415 | elif type == 'a': |
|
415 | elif type_ == 'a': | |
416 | added.append(fn) |
|
416 | added.append(fn) | |
417 | elif type == 'r': |
|
417 | elif type_ == 'r': | |
418 | removed.append(fn) |
|
418 | removed.append(fn) | |
419 |
|
419 | |||
420 | return (lookup, modified, added, removed, deleted, unknown) |
|
420 | return (lookup, modified, added, removed, deleted, unknown) |
@@ -231,7 +231,7 b' class localrepository(object):' | |||||
231 | self.join("journal"), after) |
|
231 | self.join("journal"), after) | |
232 |
|
232 | |||
233 | def recover(self): |
|
233 | def recover(self): | |
234 |
l |
|
234 | l = self.lock() | |
235 | if os.path.exists(self.join("journal")): |
|
235 | if os.path.exists(self.join("journal")): | |
236 | self.ui.status(_("rolling back interrupted transaction\n")) |
|
236 | self.ui.status(_("rolling back interrupted transaction\n")) | |
237 | transaction.rollback(self.opener, self.join("journal")) |
|
237 | transaction.rollback(self.opener, self.join("journal")) | |
@@ -245,7 +245,7 b' class localrepository(object):' | |||||
245 | def undo(self, wlock=None): |
|
245 | def undo(self, wlock=None): | |
246 | if not wlock: |
|
246 | if not wlock: | |
247 | wlock = self.wlock() |
|
247 | wlock = self.wlock() | |
248 |
l |
|
248 | l = self.lock() | |
249 | if os.path.exists(self.join("undo")): |
|
249 | if os.path.exists(self.join("undo")): | |
250 | self.ui.status(_("rolling back last transaction\n")) |
|
250 | self.ui.status(_("rolling back last transaction\n")) | |
251 | transaction.rollback(self.opener, self.join("undo")) |
|
251 | transaction.rollback(self.opener, self.join("undo")) | |
@@ -311,7 +311,7 b' class localrepository(object):' | |||||
311 |
|
311 | |||
312 | if not wlock: |
|
312 | if not wlock: | |
313 | wlock = self.wlock() |
|
313 | wlock = self.wlock() | |
314 |
l |
|
314 | l = self.lock() | |
315 | tr = self.transaction() |
|
315 | tr = self.transaction() | |
316 | mm = m1.copy() |
|
316 | mm = m1.copy() | |
317 | mfm = mf1.copy() |
|
317 | mfm = mf1.copy() | |
@@ -388,7 +388,7 b' class localrepository(object):' | |||||
388 |
|
388 | |||
389 | if not wlock: |
|
389 | if not wlock: | |
390 | wlock = self.wlock() |
|
390 | wlock = self.wlock() | |
391 |
l |
|
391 | l = self.lock() | |
392 | tr = self.transaction() |
|
392 | tr = self.transaction() | |
393 |
|
393 | |||
394 | # check in files |
|
394 | # check in files | |
@@ -931,7 +931,7 b' class localrepository(object):' | |||||
931 | return subset |
|
931 | return subset | |
932 |
|
932 | |||
933 | def pull(self, remote, heads=None): |
|
933 | def pull(self, remote, heads=None): | |
934 |
l |
|
934 | l = self.lock() | |
935 |
|
935 | |||
936 | # if we have an empty repo, fetch everything |
|
936 | # if we have an empty repo, fetch everything | |
937 | if self.changelog.tip() == nullid: |
|
937 | if self.changelog.tip() == nullid: | |
@@ -951,7 +951,7 b' class localrepository(object):' | |||||
951 | return self.addchangegroup(cg) |
|
951 | return self.addchangegroup(cg) | |
952 |
|
952 | |||
953 | def push(self, remote, force=False): |
|
953 | def push(self, remote, force=False): | |
954 |
l |
|
954 | l = remote.lock() | |
955 |
|
955 | |||
956 | base = {} |
|
956 | base = {} | |
957 | heads = remote.heads() |
|
957 | heads = remote.heads() |
@@ -624,12 +624,10 b' class revlog(object):' | |||||
624 | # we store negative distances because heap returns smallest member |
|
624 | # we store negative distances because heap returns smallest member | |
625 | h = [(-dist[node], node)] |
|
625 | h = [(-dist[node], node)] | |
626 | seen = {} |
|
626 | seen = {} | |
627 | earliest = self.count() |
|
|||
628 | while h: |
|
627 | while h: | |
629 | d, n = heapq.heappop(h) |
|
628 | d, n = heapq.heappop(h) | |
630 | if n not in seen: |
|
629 | if n not in seen: | |
631 | seen[n] = 1 |
|
630 | seen[n] = 1 | |
632 | r = self.rev(n) |
|
|||
633 | yield (-d, n) |
|
631 | yield (-d, n) | |
634 | for p in self.parents(n): |
|
632 | for p in self.parents(n): | |
635 | heapq.heappush(h, (-dist[p], p)) |
|
633 | heapq.heappush(h, (-dist[p], p)) | |
@@ -690,11 +688,6 b' class revlog(object):' | |||||
690 | p = self.parents(self.node(revs[0]))[0] |
|
688 | p = self.parents(self.node(revs[0]))[0] | |
691 | revs.insert(0, self.rev(p)) |
|
689 | revs.insert(0, self.rev(p)) | |
692 |
|
690 | |||
693 | # helper to reconstruct intermediate versions |
|
|||
694 | def construct(text, base, rev): |
|
|||
695 | bins = [self.chunk(r) for r in xrange(base + 1, rev + 1)] |
|
|||
696 | return mdiff.patches(text, bins) |
|
|||
697 |
|
||||
698 | # build deltas |
|
691 | # build deltas | |
699 | for d in xrange(0, len(revs) - 1): |
|
692 | for d in xrange(0, len(revs) - 1): | |
700 | a, b = revs[d], revs[d + 1] |
|
693 | a, b = revs[d], revs[d + 1] | |
@@ -738,10 +731,10 b' class revlog(object):' | |||||
738 | base = prev = -1 |
|
731 | base = prev = -1 | |
739 | start = end = measure = 0 |
|
732 | start = end = measure = 0 | |
740 | if r: |
|
733 | if r: | |
741 |
|
|
734 | base = self.base(t) | |
|
735 | start = self.start(base) | |||
742 | end = self.end(t) |
|
736 | end = self.end(t) | |
743 |
measure = self.length( |
|
737 | measure = self.length(base) | |
744 | base = self.base(t) |
|
|||
745 | prev = self.tip() |
|
738 | prev = self.tip() | |
746 |
|
739 | |||
747 | transaction.add(self.datafile, end) |
|
740 | transaction.add(self.datafile, end) | |
@@ -793,14 +786,15 b' class revlog(object):' | |||||
793 | raise RevlogError(_("consistency error adding group")) |
|
786 | raise RevlogError(_("consistency error adding group")) | |
794 | measure = len(text) |
|
787 | measure = len(text) | |
795 | else: |
|
788 | else: | |
796 |
e = (end, len(cdelta), |
|
789 | e = (end, len(cdelta), base, link, p1, p2, node) | |
797 | self.index.append(e) |
|
790 | self.index.append(e) | |
798 | self.nodemap[node] = r |
|
791 | self.nodemap[node] = r | |
799 | dfh.write(cdelta) |
|
792 | dfh.write(cdelta) | |
800 | ifh.write(struct.pack(indexformat, *e)) |
|
793 | ifh.write(struct.pack(indexformat, *e)) | |
801 |
|
794 | |||
802 | t, r, chain, prev = r, r + 1, node, node |
|
795 | t, r, chain, prev = r, r + 1, node, node | |
803 |
|
|
796 | base = self.base(t) | |
|
797 | start = self.start(base) | |||
804 | end = self.end(t) |
|
798 | end = self.end(t) | |
805 |
|
799 | |||
806 | dfh.close() |
|
800 | dfh.close() |
General Comments 0
You need to be logged in to leave comments.
Login now