Show More
@@ -47,7 +47,7 b' def dodiff(ui, repo, path, files = None,' | |||||
47 | (c, a, d, u) = repo.diffdir(path, node1) |
|
47 | (c, a, d, u) = repo.diffdir(path, node1) | |
48 | if not node1: |
|
48 | if not node1: | |
49 | node1 = repo.dirstate.parents()[0] |
|
49 | node1 = repo.dirstate.parents()[0] | |
50 |
def read(f): return |
|
50 | def read(f): return repo.wfile(f).read() | |
51 |
|
51 | |||
52 | if ui.quiet: |
|
52 | if ui.quiet: | |
53 | r = None |
|
53 | r = None | |
@@ -272,7 +272,7 b' def debugchangegroup(ui, repo, roots):' | |||||
272 | sys.stdout.write(chunk) |
|
272 | sys.stdout.write(chunk) | |
273 |
|
273 | |||
274 | def debugindex(ui, file): |
|
274 | def debugindex(ui, file): | |
275 | r = hg.revlog(open, file, "") |
|
275 | r = hg.revlog(hg.opener(""), file, "") | |
276 | print " rev offset length base linkrev"+\ |
|
276 | print " rev offset length base linkrev"+\ | |
277 | " p1 p2 nodeid" |
|
277 | " p1 p2 nodeid" | |
278 | for i in range(r.count()): |
|
278 | for i in range(r.count()): | |
@@ -282,7 +282,7 b' def debugindex(ui, file):' | |||||
282 | hg.hex(e[4][:5]), hg.hex(e[5][:5]), hg.hex(e[6][:5])) |
|
282 | hg.hex(e[4][:5]), hg.hex(e[5][:5]), hg.hex(e[6][:5])) | |
283 |
|
283 | |||
284 | def debugindexdot(ui, file): |
|
284 | def debugindexdot(ui, file): | |
285 | r = hg.revlog(open, file, "") |
|
285 | r = hg.revlog(hg.opener(""), file, "") | |
286 | print "digraph G {" |
|
286 | print "digraph G {" | |
287 | for i in range(r.count()): |
|
287 | for i in range(r.count()): | |
288 | e = r.index[i] |
|
288 | e = r.index[i] |
@@ -336,7 +336,7 b' def opener(base):' | |||||
336 | os.makedirs(d) |
|
336 | os.makedirs(d) | |
337 | else: |
|
337 | else: | |
338 | if s.st_nlink > 1: |
|
338 | if s.st_nlink > 1: | |
339 | file(f + ".tmp", "w").write(file(f).read()) |
|
339 | file(f + ".tmp", "wb").write(file(f, "rb").read()) | |
340 | os.rename(f+".tmp", f) |
|
340 | os.rename(f+".tmp", f) | |
341 |
|
341 | |||
342 | return file(f, mode) |
|
342 | return file(f, mode) | |
@@ -386,7 +386,7 b' class localrepository:' | |||||
386 | if self.ignorelist is None: |
|
386 | if self.ignorelist is None: | |
387 | self.ignorelist = [] |
|
387 | self.ignorelist = [] | |
388 | try: |
|
388 | try: | |
389 |
l = self.w |
|
389 | l = file(self.wjoin(".hgignore")) | |
390 | for pat in l: |
|
390 | for pat in l: | |
391 | if pat != "\n": |
|
391 | if pat != "\n": | |
392 | self.ignorelist.append(re.compile(pat[:-1])) |
|
392 | self.ignorelist.append(re.compile(pat[:-1])) | |
@@ -569,7 +569,7 b' class localrepository:' | |||||
569 | try: |
|
569 | try: | |
570 | fp = self.wjoin(f) |
|
570 | fp = self.wjoin(f) | |
571 | mf1[f] = is_exec(fp) |
|
571 | mf1[f] = is_exec(fp) | |
572 |
t = |
|
572 | t = self.wopener(f).read() | |
573 | except IOError: |
|
573 | except IOError: | |
574 | self.warn("trouble committing %s!\n" % f) |
|
574 | self.warn("trouble committing %s!\n" % f) | |
575 | raise |
|
575 | raise | |
@@ -1198,7 +1198,7 b' class localrepository:' | |||||
1198 | def temp(prefix, node): |
|
1198 | def temp(prefix, node): | |
1199 | pre = "%s~%s." % (os.path.basename(fn), prefix) |
|
1199 | pre = "%s~%s." % (os.path.basename(fn), prefix) | |
1200 | (fd, name) = tempfile.mkstemp("", pre) |
|
1200 | (fd, name) = tempfile.mkstemp("", pre) | |
1201 | f = os.fdopen(fd, "w") |
|
1201 | f = os.fdopen(fd, "wb") | |
1202 | f.write(fl.revision(node)) |
|
1202 | f.write(fl.revision(node)) | |
1203 | f.close() |
|
1203 | f.close() | |
1204 | return name |
|
1204 | return name |
General Comments 0
You need to be logged in to leave comments.
Login now