Show More
@@ -11,4 +11,3 b'' | |||||
11 | from mercurial import commands |
|
11 | from mercurial import commands | |
12 |
|
12 | |||
13 | commands.run() |
|
13 | commands.run() | |
14 |
|
@@ -312,12 +312,12 b' def clone(ui, source, dest = None, **opt' | |||||
312 | update(ui, repo) |
|
312 | update(ui, repo) | |
313 |
|
313 | |||
314 | success = True |
|
314 | success = True | |
315 |
|
315 | |||
316 | finally: |
|
316 | finally: | |
317 | if created and not success: |
|
317 | if created and not success: | |
318 | import shutil |
|
318 | import shutil | |
319 | shutil.rmtree(dest, True) |
|
319 | shutil.rmtree(dest, True) | |
320 |
|
320 | |||
321 | def commit(ui, repo, *files, **opts): |
|
321 | def commit(ui, repo, *files, **opts): | |
322 | """commit the specified files or all outstanding changes""" |
|
322 | """commit the specified files or all outstanding changes""" | |
323 | text = opts['text'] |
|
323 | text = opts['text'] |
@@ -10,7 +10,7 b' def fancyopts(args, options, state, synt' | |||||
10 | map['-'+s] = map['--'+l]=l |
|
10 | map['-'+s] = map['--'+l]=l | |
11 | state[l] = d |
|
11 | state[l] = d | |
12 | dt[l] = type(d) |
|
12 | dt[l] = type(d) | |
13 |
if not d is None and not callable(d): s, l=s+':', l+'=' |
|
13 | if not d is None and not callable(d): s, l=s+':', l+'=' | |
14 | if s: short = short + s |
|
14 | if s: short = short + s | |
15 | if l: long.append(l) |
|
15 | if l: long.append(l) | |
16 |
|
16 |
@@ -231,7 +231,7 b' class dirstate:' | |||||
231 | l = e[4] |
|
231 | l = e[4] | |
232 | pos += 17 |
|
232 | pos += 17 | |
233 | f = st[pos:pos + l] |
|
233 | f = st[pos:pos + l] | |
234 |
if '\0' in f: |
|
234 | if '\0' in f: | |
235 | f, c = f.split('\0') |
|
235 | f, c = f.split('\0') | |
236 | self.copies[f] = c |
|
236 | self.copies[f] = c | |
237 | self.map[f] = e[:4] |
|
237 | self.map[f] = e[:4] | |
@@ -244,7 +244,7 b' class dirstate:' | |||||
244 |
|
244 | |||
245 | def copied(self, file): |
|
245 | def copied(self, file): | |
246 | return self.copies.get(file, None) |
|
246 | return self.copies.get(file, None) | |
247 |
|
247 | |||
248 | def update(self, files, state): |
|
248 | def update(self, files, state): | |
249 | ''' current states: |
|
249 | ''' current states: | |
250 | n normal |
|
250 | n normal | |
@@ -345,7 +345,7 b' class localrepository:' | |||||
345 | self.ui = ui |
|
345 | self.ui = ui | |
346 |
|
346 | |||
347 | if create: |
|
347 | if create: | |
348 |
os.mkdir(self.path) |
|
348 | os.mkdir(self.path) | |
349 | os.mkdir(self.join("data")) |
|
349 | os.mkdir(self.join("data")) | |
350 |
|
350 | |||
351 | self.opener = opener(self.path) |
|
351 | self.opener = opener(self.path) | |
@@ -478,7 +478,7 b' class localrepository:' | |||||
478 | except IOError: |
|
478 | except IOError: | |
479 | ds = "" |
|
479 | ds = "" | |
480 | self.opener("undo.dirstate", "w").write(ds) |
|
480 | self.opener("undo.dirstate", "w").write(ds) | |
481 |
|
481 | |||
482 | return transaction.transaction(self.opener, self.join("journal"), |
|
482 | return transaction.transaction(self.opener, self.join("journal"), | |
483 | self.join("undo")) |
|
483 | self.join("undo")) | |
484 |
|
484 | |||
@@ -668,7 +668,7 b' class localrepository:' | |||||
668 | for dir, subdirs, files in os.walk(path): |
|
668 | for dir, subdirs, files in os.walk(path): | |
669 | d = dir[len(self.root)+1:] |
|
669 | d = dir[len(self.root)+1:] | |
670 | if ".hg" in subdirs: subdirs.remove(".hg") |
|
670 | if ".hg" in subdirs: subdirs.remove(".hg") | |
671 |
|
671 | |||
672 | for f in files: |
|
672 | for f in files: | |
673 | fn = util.pconvert(os.path.join(d, f)) |
|
673 | fn = util.pconvert(os.path.join(d, f)) | |
674 | try: s = os.stat(os.path.join(self.root, fn)) |
|
674 | try: s = os.stat(os.path.join(self.root, fn)) | |
@@ -714,10 +714,10 b' class localrepository:' | |||||
714 | del mf1[fn] |
|
714 | del mf1[fn] | |
715 | else: |
|
715 | else: | |
716 | added.append(fn) |
|
716 | added.append(fn) | |
717 |
|
717 | |||
718 | deleted = mf1.keys() |
|
718 | deleted = mf1.keys() | |
719 | deleted.sort() |
|
719 | deleted.sort() | |
720 |
|
720 | |||
721 | return (changed, added, deleted) |
|
721 | return (changed, added, deleted) | |
722 |
|
722 | |||
723 | def add(self, list): |
|
723 | def add(self, list): | |
@@ -846,7 +846,7 b' class localrepository:' | |||||
846 |
|
846 | |||
847 | rep = {} |
|
847 | rep = {} | |
848 | reqcnt = 0 |
|
848 | reqcnt = 0 | |
849 |
|
849 | |||
850 | unknown = remote.branches(unknown) |
|
850 | unknown = remote.branches(unknown) | |
851 | while unknown: |
|
851 | while unknown: | |
852 | r = [] |
|
852 | r = [] | |
@@ -891,7 +891,7 b' class localrepository:' | |||||
891 | (short(b[0]), short(b[1]))) |
|
891 | (short(b[0]), short(b[1]))) | |
892 | if b[0] not in m and b[0] not in seen: |
|
892 | if b[0] not in m and b[0] not in seen: | |
893 | unknown.append(b) |
|
893 | unknown.append(b) | |
894 |
|
894 | |||
895 | while search: |
|
895 | while search: | |
896 | n = search.pop(0) |
|
896 | n = search.pop(0) | |
897 | reqcnt += 1 |
|
897 | reqcnt += 1 | |
@@ -969,7 +969,7 b' class localrepository:' | |||||
969 | break |
|
969 | break | |
970 | d, self.buf = self.buf[:l], self.buf[l:] |
|
970 | d, self.buf = self.buf[:l], self.buf[l:] | |
971 | return d |
|
971 | return d | |
972 |
|
972 | |||
973 | def getchunk(): |
|
973 | def getchunk(): | |
974 | d = source.read(4) |
|
974 | d = source.read(4) | |
975 | if not d: return "" |
|
975 | if not d: return "" | |
@@ -1270,7 +1270,7 b' class localrepository:' | |||||
1270 | self.ui.warn("duplicate changeset at revision %d\n" % i) |
|
1270 | self.ui.warn("duplicate changeset at revision %d\n" % i) | |
1271 | errors += 1 |
|
1271 | errors += 1 | |
1272 | seen[n] = 1 |
|
1272 | seen[n] = 1 | |
1273 |
|
1273 | |||
1274 | for p in self.changelog.parents(n): |
|
1274 | for p in self.changelog.parents(n): | |
1275 | if p not in self.changelog.nodemap: |
|
1275 | if p not in self.changelog.nodemap: | |
1276 | self.ui.warn("changeset %s has unknown parent %s\n" % |
|
1276 | self.ui.warn("changeset %s has unknown parent %s\n" % | |
@@ -1293,7 +1293,7 b' class localrepository:' | |||||
1293 | self.ui.warn("duplicate manifest at revision %d\n" % i) |
|
1293 | self.ui.warn("duplicate manifest at revision %d\n" % i) | |
1294 | errors += 1 |
|
1294 | errors += 1 | |
1295 | seen[n] = 1 |
|
1295 | seen[n] = 1 | |
1296 |
|
1296 | |||
1297 | for p in self.manifest.parents(n): |
|
1297 | for p in self.manifest.parents(n): | |
1298 | if p not in self.manifest.nodemap: |
|
1298 | if p not in self.manifest.nodemap: | |
1299 | self.ui.warn("manifest %s has unknown parent %s\n" % |
|
1299 | self.ui.warn("manifest %s has unknown parent %s\n" % | |
@@ -1408,7 +1408,7 b' class remoterepository:' | |||||
1408 | no = os.environ.get("no_proxy") |
|
1408 | no = os.environ.get("no_proxy") | |
1409 | if no: |
|
1409 | if no: | |
1410 | no_list = no_list + no.split(",") |
|
1410 | no_list = no_list + no.split(",") | |
1411 |
|
1411 | |||
1412 | no_proxy = 0 |
|
1412 | no_proxy = 0 | |
1413 | for h in no_list: |
|
1413 | for h in no_list: | |
1414 | if (path.startswith("http://" + h + "/") or |
|
1414 | if (path.startswith("http://" + h + "/") or |
@@ -76,7 +76,7 b' def template(tmpl, filters = {}, **map):' | |||||
76 | if fl: |
|
76 | if fl: | |
77 | for f in fl.split("|")[1:]: |
|
77 | for f in fl.split("|")[1:]: | |
78 | v = filters[f](v) |
|
78 | v = filters[f](v) | |
79 |
|
79 | |||
80 | yield v |
|
80 | yield v | |
81 | tmpl = tmpl[m.end(0):] |
|
81 | tmpl = tmpl[m.end(0):] | |
82 | else: |
|
82 | else: | |
@@ -89,7 +89,7 b' class templater:' | |||||
89 | self.map = {} |
|
89 | self.map = {} | |
90 | self.base = os.path.dirname(mapfile) |
|
90 | self.base = os.path.dirname(mapfile) | |
91 | self.filters = filters |
|
91 | self.filters = filters | |
92 |
|
92 | |||
93 | for l in file(mapfile): |
|
93 | for l in file(mapfile): | |
94 | m = re.match(r'(\S+)\s*=\s*"(.*)"$', l) |
|
94 | m = re.match(r'(\S+)\s*=\s*"(.*)"$', l) | |
95 | if m: |
|
95 | if m: | |
@@ -107,7 +107,7 b' class templater:' | |||||
107 | except KeyError: |
|
107 | except KeyError: | |
108 | tmpl = self.cache[t] = file(self.map[t]).read() |
|
108 | tmpl = self.cache[t] = file(self.map[t]).read() | |
109 | return template(tmpl, self.filters, **map) |
|
109 | return template(tmpl, self.filters, **map) | |
110 |
|
110 | |||
111 | class hgweb: |
|
111 | class hgweb: | |
112 | maxchanges = 10 |
|
112 | maxchanges = 10 | |
113 | maxfiles = 10 |
|
113 | maxfiles = 10 | |
@@ -158,7 +158,7 b' class hgweb:' | |||||
158 | def diff(self, node1, node2, files): |
|
158 | def diff(self, node1, node2, files): | |
159 | def filterfiles(list, files): |
|
159 | def filterfiles(list, files): | |
160 | l = [ x for x in list if x in files ] |
|
160 | l = [ x for x in list if x in files ] | |
161 |
|
161 | |||
162 | for f in files: |
|
162 | for f in files: | |
163 | if f[-1] != os.sep: f += os.sep |
|
163 | if f[-1] != os.sep: f += os.sep | |
164 | l += [ x for x in list if x.startswith(f) ] |
|
164 | l += [ x for x in list if x.startswith(f) ] | |
@@ -172,7 +172,7 b' class hgweb:' | |||||
172 | file = f, |
|
172 | file = f, | |
173 | filenode = hex(fn or nullid)) |
|
173 | filenode = hex(fn or nullid)) | |
174 | parity[0] = 1 - parity[0] |
|
174 | parity[0] = 1 - parity[0] | |
175 |
|
175 | |||
176 | def prettyprintlines(diff): |
|
176 | def prettyprintlines(diff): | |
177 | for l in diff.splitlines(1): |
|
177 | for l in diff.splitlines(1): | |
178 | if l.startswith('+'): |
|
178 | if l.startswith('+'): | |
@@ -234,7 +234,7 b' class hgweb:' | |||||
234 | if pos - f >= 0: l.insert(0, ("-" + r, pos - f)) |
|
234 | if pos - f >= 0: l.insert(0, ("-" + r, pos - f)) | |
235 |
|
235 | |||
236 | yield self.t("naventry", rev = 0, label="(0)") |
|
236 | yield self.t("naventry", rev = 0, label="(0)") | |
237 |
|
237 | |||
238 | for label, rev in l: |
|
238 | for label, rev in l: | |
239 | yield self.t("naventry", label = label, rev = rev) |
|
239 | yield self.t("naventry", label = label, rev = rev) | |
240 |
|
240 | |||
@@ -293,7 +293,7 b' class hgweb:' | |||||
293 | p1, p2 = cl.parents(n) |
|
293 | p1, p2 = cl.parents(n) | |
294 | p1rev, p2rev = cl.rev(p1), cl.rev(p2) |
|
294 | p1rev, p2rev = cl.rev(p1), cl.rev(p2) | |
295 | t = float(changes[2].split(' ')[0]) |
|
295 | t = float(changes[2].split(' ')[0]) | |
296 |
|
296 | |||
297 | files = [] |
|
297 | files = [] | |
298 | mf = self.repo.manifest.read(changes[0]) |
|
298 | mf = self.repo.manifest.read(changes[0]) | |
299 | for f in changes[3]: |
|
299 | for f in changes[3]: | |
@@ -330,7 +330,7 b' class hgweb:' | |||||
330 | def entries(): |
|
330 | def entries(): | |
331 | l = [] |
|
331 | l = [] | |
332 | parity = (count - 1) & 1 |
|
332 | parity = (count - 1) & 1 | |
333 |
|
333 | |||
334 | for i in range(count): |
|
334 | for i in range(count): | |
335 |
|
335 | |||
336 | n = fl.node(i) |
|
336 | n = fl.node(i) | |
@@ -423,7 +423,7 b' class hgweb:' | |||||
423 | cnode = ncache[r] |
|
423 | cnode = ncache[r] | |
424 | except KeyError: |
|
424 | except KeyError: | |
425 | cnode = ncache[r] = self.repo.changelog.node(r) |
|
425 | cnode = ncache[r] = self.repo.changelog.node(r) | |
426 |
|
426 | |||
427 | try: |
|
427 | try: | |
428 | name = bcache[r] |
|
428 | name = bcache[r] | |
429 | except KeyError: |
|
429 | except KeyError: | |
@@ -474,7 +474,7 b' class hgweb:' | |||||
474 | mff=self.repo.manifest.readflags(bin(mnode)) |
|
474 | mff=self.repo.manifest.readflags(bin(mnode)) | |
475 |
|
475 | |||
476 | files = {} |
|
476 | files = {} | |
477 |
|
477 | |||
478 | p = path[1:] |
|
478 | p = path[1:] | |
479 | l = len(p) |
|
479 | l = len(p) | |
480 |
|
480 | |||
@@ -501,7 +501,7 b' class hgweb:' | |||||
501 | manifest = mnode, |
|
501 | manifest = mnode, | |
502 | filenode = hex(fnode), |
|
502 | filenode = hex(fnode), | |
503 | parity = parity, |
|
503 | parity = parity, | |
504 |
basename = f, |
|
504 | basename = f, | |
505 | permissions = mff[full]) |
|
505 | permissions = mff[full]) | |
506 | else: |
|
506 | else: | |
507 | yield self.t("manifestdirentry", |
|
507 | yield self.t("manifestdirentry", | |
@@ -550,7 +550,7 b' class hgweb:' | |||||
550 | p1 = cl.parents(n)[0] |
|
550 | p1 = cl.parents(n)[0] | |
551 | cs = cl.read(n) |
|
551 | cs = cl.read(n) | |
552 | mf = self.repo.manifest.read(cs[0]) |
|
552 | mf = self.repo.manifest.read(cs[0]) | |
553 |
|
553 | |||
554 | def diff(): |
|
554 | def diff(): | |
555 | yield self.diff(p1, n, file) |
|
555 | yield self.diff(p1, n, file) | |
556 |
|
556 | |||
@@ -565,7 +565,7 b' class hgweb:' | |||||
565 | p1 = hex(p1), |
|
565 | p1 = hex(p1), | |
566 | p1rev = self.repo.changelog.rev(p1), |
|
566 | p1rev = self.repo.changelog.rev(p1), | |
567 | diff = diff) |
|
567 | diff = diff) | |
568 |
|
568 | |||
569 | # add tags to things |
|
569 | # add tags to things | |
570 | # tags -> list of changesets corresponding to tags |
|
570 | # tags -> list of changesets corresponding to tags | |
571 | # find tag, changeset, file |
|
571 | # find tag, changeset, file | |
@@ -579,7 +579,7 b' class hgweb:' | |||||
579 | b = os.path.basename("map-" + args['style'][0]) |
|
579 | b = os.path.basename("map-" + args['style'][0]) | |
580 | p = os.path.join(self.templates, b) |
|
580 | p = os.path.join(self.templates, b) | |
581 | if os.path.isfile(p): m = p |
|
581 | if os.path.isfile(p): m = p | |
582 |
|
582 | |||
583 | self.t = templater(m, self.filters) |
|
583 | self.t = templater(m, self.filters) | |
584 |
|
584 | |||
585 | if not args.has_key('cmd') or args['cmd'][0] == 'changelog': |
|
585 | if not args.has_key('cmd') or args['cmd'][0] == 'changelog': | |
@@ -591,7 +591,7 b' class hgweb:' | |||||
591 | except KeyError: pass |
|
591 | except KeyError: pass | |
592 |
|
592 | |||
593 | write(self.changelog(hi)) |
|
593 | write(self.changelog(hi)) | |
594 |
|
594 | |||
595 | elif args['cmd'][0] == 'changeset': |
|
595 | elif args['cmd'][0] == 'changeset': | |
596 | write(self.changeset(args['node'][0])) |
|
596 | write(self.changeset(args['node'][0])) | |
597 |
|
597 | |||
@@ -674,7 +674,7 b' def server(path, name, templates, addres' | |||||
674 | if p: |
|
674 | if p: | |
675 | query = self.path[p + 1:] |
|
675 | query = self.path[p + 1:] | |
676 | query = query.replace('+', ' ') |
|
676 | query = query.replace('+', ' ') | |
677 |
|
677 | |||
678 | env = {} |
|
678 | env = {} | |
679 | env['GATEWAY_INTERFACE'] = 'CGI/1.1' |
|
679 | env['GATEWAY_INTERFACE'] = 'CGI/1.1' | |
680 | env['REQUEST_METHOD'] = self.command |
|
680 | env['REQUEST_METHOD'] = self.command |
@@ -31,7 +31,7 b' class lock:' | |||||
31 | time.sleep(1) |
|
31 | time.sleep(1) | |
32 | continue |
|
32 | continue | |
33 | raise inst |
|
33 | raise inst | |
34 |
|
34 | |||
35 | def trylock(self): |
|
35 | def trylock(self): | |
36 | pid = os.getpid() |
|
36 | pid = os.getpid() | |
37 | try: |
|
37 | try: |
@@ -47,7 +47,7 b' def sortdiff(a, b):' | |||||
47 | la = lb = 0 |
|
47 | la = lb = 0 | |
48 | lena = len(a) |
|
48 | lena = len(a) | |
49 | lenb = len(b) |
|
49 | lenb = len(b) | |
50 |
|
50 | |||
51 | while 1: |
|
51 | while 1: | |
52 | am, bm, = la, lb |
|
52 | am, bm, = la, lb | |
53 |
|
53 | |||
@@ -65,14 +65,14 b' def sortdiff(a, b):' | |||||
65 |
|
65 | |||
66 | if lb >= lenb: |
|
66 | if lb >= lenb: | |
67 | break |
|
67 | break | |
68 |
|
68 | |||
69 | # skip mismatched lines from a |
|
69 | # skip mismatched lines from a | |
70 | while la < lena and lb < lenb and b[lb] > a[la]: |
|
70 | while la < lena and lb < lenb and b[lb] > a[la]: | |
71 | la += 1 |
|
71 | la += 1 | |
72 |
|
72 | |||
73 | if la >= lena: |
|
73 | if la >= lena: | |
74 | break |
|
74 | break | |
75 |
|
75 | |||
76 | yield (lena, lenb, 0) |
|
76 | yield (lena, lenb, 0) | |
77 |
|
77 | |||
78 | def diff(a, b, sorted=0): |
|
78 | def diff(a, b, sorted=0): | |
@@ -100,7 +100,7 b' def diff(a, b, sorted=0):' | |||||
100 | bin.append(struct.pack(">lll", p[la], p[am], len(s)) + s) |
|
100 | bin.append(struct.pack(">lll", p[la], p[am], len(s)) + s) | |
101 | la = am + size |
|
101 | la = am + size | |
102 | lb = bm + size |
|
102 | lb = bm + size | |
103 |
|
103 | |||
104 | return "".join(bin) |
|
104 | return "".join(bin) | |
105 |
|
105 | |||
106 | def patchtext(bin): |
|
106 | def patchtext(bin): |
@@ -64,14 +64,14 b' class lazyparser:' | |||||
64 | end = self.l |
|
64 | end = self.l | |
65 | self.revlog.index = self.index |
|
65 | self.revlog.index = self.index | |
66 | self.revlog.nodemap = self.map |
|
66 | self.revlog.nodemap = self.map | |
67 |
|
67 | |||
68 | while i < end: |
|
68 | while i < end: | |
69 | d = self.data[i * self.s: (i + 1) * self.s] |
|
69 | d = self.data[i * self.s: (i + 1) * self.s] | |
70 | e = struct.unpack(indexformat, d) |
|
70 | e = struct.unpack(indexformat, d) | |
71 | self.index[i] = e |
|
71 | self.index[i] = e | |
72 | self.map[e[6]] = i |
|
72 | self.map[e[6]] = i | |
73 | i += 1 |
|
73 | i += 1 | |
74 |
|
74 | |||
75 | class lazyindex: |
|
75 | class lazyindex: | |
76 | def __init__(self, parser): |
|
76 | def __init__(self, parser): | |
77 | self.p = parser |
|
77 | self.p = parser | |
@@ -84,7 +84,7 b' class lazyindex:' | |||||
84 | return self.p.index[pos] or self.load(pos) |
|
84 | return self.p.index[pos] or self.load(pos) | |
85 | def append(self, e): |
|
85 | def append(self, e): | |
86 | self.p.index.append(e) |
|
86 | self.p.index.append(e) | |
87 |
|
87 | |||
88 | class lazymap: |
|
88 | class lazymap: | |
89 | def __init__(self, parser): |
|
89 | def __init__(self, parser): | |
90 | self.p = parser |
|
90 | self.p = parser | |
@@ -150,7 +150,6 b' class revlog:' | |||||
150 |
|
150 | |||
151 | self.nodemap = dict(m) |
|
151 | self.nodemap = dict(m) | |
152 | self.nodemap[nullid] = -1 |
|
152 | self.nodemap[nullid] = -1 | |
153 |
|
||||
154 |
|
153 | |||
155 | def tip(self): return self.node(len(self.index) - 1) |
|
154 | def tip(self): return self.node(len(self.index) - 1) | |
156 | def count(self): return len(self.index) |
|
155 | def count(self): return len(self.index) | |
@@ -189,7 +188,7 b' class revlog:' | |||||
189 | elif pn == nullid: |
|
188 | elif pn == nullid: | |
190 | continue |
|
189 | continue | |
191 | return c |
|
190 | return c | |
192 |
|
191 | |||
193 | def lookup(self, id): |
|
192 | def lookup(self, id): | |
194 | try: |
|
193 | try: | |
195 | rev = int(id) |
|
194 | rev = int(id) | |
@@ -205,7 +204,7 b' class revlog:' | |||||
205 | if len(c) > 1: raise KeyError("Ambiguous identifier") |
|
204 | if len(c) > 1: raise KeyError("Ambiguous identifier") | |
206 | if len(c) < 1: raise KeyError("No match found") |
|
205 | if len(c) < 1: raise KeyError("No match found") | |
207 | return c[0] |
|
206 | return c[0] | |
208 |
|
207 | |||
209 | return None |
|
208 | return None | |
210 |
|
209 | |||
211 | def diff(self, a, b): |
|
210 | def diff(self, a, b): | |
@@ -263,7 +262,7 b' class revlog:' | |||||
263 | % (self.datafile, rev)) |
|
262 | % (self.datafile, rev)) | |
264 |
|
263 | |||
265 | self.cache = (node, rev, text) |
|
264 | self.cache = (node, rev, text) | |
266 |
return text |
|
265 | return text | |
267 |
|
266 | |||
268 | def addrevision(self, text, transaction, link, p1=None, p2=None): |
|
267 | def addrevision(self, text, transaction, link, p1=None, p2=None): | |
269 | if text is None: text = "" |
|
268 | if text is None: text = "" | |
@@ -300,7 +299,7 b' class revlog:' | |||||
300 | offset = self.end(t) |
|
299 | offset = self.end(t) | |
301 |
|
300 | |||
302 | e = (offset, len(data), base, link, p1, p2, node) |
|
301 | e = (offset, len(data), base, link, p1, p2, node) | |
303 |
|
302 | |||
304 | self.index.append(e) |
|
303 | self.index.append(e) | |
305 | self.nodemap[node] = n |
|
304 | self.nodemap[node] = n | |
306 | entry = struct.pack(indexformat, *e) |
|
305 | entry = struct.pack(indexformat, *e) | |
@@ -320,7 +319,7 b' class revlog:' | |||||
320 | n = self.node(i) |
|
319 | n = self.node(i) | |
321 | p1, p2 = self.parents(n) |
|
320 | p1, p2 = self.parents(n) | |
322 | dist[n] = max(dist[p1], dist[p2]) + 1 |
|
321 | dist[n] = max(dist[p1], dist[p2]) + 1 | |
323 |
|
322 | |||
324 | # traverse ancestors in order of decreasing distance from root |
|
323 | # traverse ancestors in order of decreasing distance from root | |
325 | def ancestors(node): |
|
324 | def ancestors(node): | |
326 | # we store negative distances because heap returns smallest member |
|
325 | # we store negative distances because heap returns smallest member | |
@@ -441,7 +440,7 b' class revlog:' | |||||
441 | ta = construct(ta, base, a) |
|
440 | ta = construct(ta, base, a) | |
442 | else: |
|
441 | else: | |
443 | ta = "" |
|
442 | ta = "" | |
444 |
|
443 | |||
445 | base = self.base(b) |
|
444 | base = self.base(b) | |
446 | if a > base: |
|
445 | if a > base: | |
447 | base = a |
|
446 | base = a | |
@@ -471,7 +470,7 b' class revlog:' | |||||
471 | r = self.count() |
|
470 | r = self.count() | |
472 | t = r - 1 |
|
471 | t = r - 1 | |
473 | node = nullid |
|
472 | node = nullid | |
474 |
|
473 | |||
475 | base = prev = -1 |
|
474 | base = prev = -1 | |
476 | start = end = 0 |
|
475 | start = end = 0 | |
477 | if r: |
|
476 | if r: |
@@ -65,7 +65,7 b' class transaction:' | |||||
65 | self.entries = [] |
|
65 | self.entries = [] | |
66 |
|
66 | |||
67 | print "rollback completed" |
|
67 | print "rollback completed" | |
68 |
|
68 | |||
69 | def rollback(opener, file): |
|
69 | def rollback(opener, file): | |
70 | for l in open(file).readlines(): |
|
70 | for l in open(file).readlines(): | |
71 | f, o = l.split('\0') |
|
71 | f, o = l.split('\0') |
@@ -84,4 +84,3 b' class ui:' | |||||
84 | t = re.sub("(?m)^HG:.*\n", "", t) |
|
84 | t = re.sub("(?m)^HG:.*\n", "", t) | |
85 |
|
85 | |||
86 | return t |
|
86 | return t | |
87 |
|
@@ -21,7 +21,7 b' def explain_exit(code):' | |||||
21 | val = os.STOPSIG(code) |
|
21 | val = os.STOPSIG(code) | |
22 | return "stopped by signal %d" % val, val |
|
22 | return "stopped by signal %d" % val, val | |
23 | raise ValueError("invalid exit code") |
|
23 | raise ValueError("invalid exit code") | |
24 |
|
24 | |||
25 | def system(cmd, errprefix = "abort"): |
|
25 | def system(cmd, errprefix = "abort"): | |
26 | """execute a shell command that must succeed""" |
|
26 | """execute a shell command that must succeed""" | |
27 | rc = os.system(cmd) |
|
27 | rc = os.system(cmd) | |
@@ -46,7 +46,7 b" if os.name == 'nt':" | |||||
46 |
|
46 | |||
47 | def set_exec(f, mode): |
|
47 | def set_exec(f, mode): | |
48 | pass |
|
48 | pass | |
49 |
|
49 | |||
50 | def pconvert(path): |
|
50 | def pconvert(path): | |
51 | return path.replace("\\", "/") |
|
51 | return path.replace("\\", "/") | |
52 |
|
52 |
General Comments 0
You need to be logged in to leave comments.
Login now