Show More
@@ -32,7 +32,7 b' def relpath(repo, args):' | |||||
32 | return [ os.path.normpath(os.path.join(p, x)) for x in args ] |
|
32 | return [ os.path.normpath(os.path.join(p, x)) for x in args ] | |
33 | return args |
|
33 | return args | |
34 |
|
34 | |||
35 | def dodiff(repo, files = None, node1 = None, node2 = None): |
|
35 | def dodiff(repo, path, files = None, node1 = None, node2 = None): | |
36 | def date(c): |
|
36 | def date(c): | |
37 | return time.asctime(time.gmtime(float(c[2].split(' ')[0]))) |
|
37 | return time.asctime(time.gmtime(float(c[2].split(' ')[0]))) | |
38 |
|
38 | |||
@@ -44,7 +44,7 b' def dodiff(repo, files = None, node1 = N' | |||||
44 | date2 = date(change) |
|
44 | date2 = date(change) | |
45 | else: |
|
45 | else: | |
46 | date2 = time.asctime() |
|
46 | date2 = time.asctime() | |
47 |
(c, a, d, u) = repo.diffdir( |
|
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 file(os.path.join(repo.root, f)).read() |
|
50 | def read(f): return file(os.path.join(repo.root, f)).read() | |
@@ -224,7 +224,7 b' def diff(ui, repo, *files, **opts):' | |||||
224 | else: |
|
224 | else: | |
225 | files = relpath(repo, [""]) |
|
225 | files = relpath(repo, [""]) | |
226 |
|
226 | |||
227 | dodiff(repo, files, *revs) |
|
227 | dodiff(repo, os.getcwd(), files, *revs) | |
228 |
|
228 | |||
229 | def export(ui, repo, changeset): |
|
229 | def export(ui, repo, changeset): | |
230 | """dump the changeset header and diffs for a revision""" |
|
230 | """dump the changeset header and diffs for a revision""" | |
@@ -241,7 +241,7 b' def export(ui, repo, changeset):' | |||||
241 | print change[4].rstrip() |
|
241 | print change[4].rstrip() | |
242 |
|
242 | |||
243 |
|
243 | |||
244 | dodiff(repo, None, prev, node) |
|
244 | dodiff(repo, "", None, prev, node) | |
245 |
|
245 | |||
246 | def forget(ui, repo, file, *files): |
|
246 | def forget(ui, repo, file, *files): | |
247 | """don't add the specified files on the next commit""" |
|
247 | """don't add the specified files on the next commit""" | |
@@ -450,7 +450,7 b' def status(ui, repo):' | |||||
450 | R = removed |
|
450 | R = removed | |
451 | ? = not tracked''' |
|
451 | ? = not tracked''' | |
452 |
|
452 | |||
453 |
(c, a, d, u) = repo.diffdir( |
|
453 | (c, a, d, u) = repo.diffdir(os.getcwd()) | |
454 | (c, a, d, u) = map(lambda x: relfilter(repo, x), (c, a, d, u)) |
|
454 | (c, a, d, u) = map(lambda x: relfilter(repo, x), (c, a, d, u)) | |
455 |
|
455 | |||
456 | for f in c: print "C", f |
|
456 | for f in c: print "C", f |
@@ -551,7 +551,7 b' class localrepository:' | |||||
551 | t2 = self.file(fn).revision(mf[fn]) |
|
551 | t2 = self.file(fn).revision(mf[fn]) | |
552 | return cmp(t1, t2) |
|
552 | return cmp(t1, t2) | |
553 |
|
553 | |||
554 |
for dir, subdirs, files in os.walk( |
|
554 | for dir, subdirs, files in os.walk(path): | |
555 | d = dir[len(self.root)+1:] |
|
555 | d = dir[len(self.root)+1:] | |
556 | if ".hg" in subdirs: subdirs.remove(".hg") |
|
556 | if ".hg" in subdirs: subdirs.remove(".hg") | |
557 |
|
557 |
General Comments 0
You need to be logged in to leave comments.
Login now