##// END OF EJS Templates
make diffdir default to dirstate.parents()...
mpm@selenic.com -
r230:00ea3613 default
parent child Browse files
Show More
@@ -250,7 +250,7 b' elif cmd == "debugaddchangegroup":'
250 repo.addchangegroup(data)
250 repo.addchangegroup(data)
251
251
252 elif cmd == "addremove":
252 elif cmd == "addremove":
253 (c, a, d, u) = repo.diffdir(repo.root, repo.current)
253 (c, a, d, u) = repo.diffdir(repo.root)
254 repo.add(a)
254 repo.add(a)
255 repo.remove(d)
255 repo.remove(d)
256
256
@@ -70,7 +70,7 b' def branch(ui, path):'
70
70
71 def checkout(ui, repo, changeset=None):
71 def checkout(ui, repo, changeset=None):
72 '''checkout a given changeset or the current tip'''
72 '''checkout a given changeset or the current tip'''
73 (c, a, d, u) = repo.diffdir(repo.root, repo.current)
73 (c, a, d, u) = repo.diffdir(repo.root)
74 if c or a or d:
74 if c or a or d:
75 ui.warn("aborting (outstanding changes in working directory)\n")
75 ui.warn("aborting (outstanding changes in working directory)\n")
76 sys.exit(1)
76 sys.exit(1)
@@ -160,7 +160,7 b' C = changed'
160 A = added
160 A = added
161 R = removed
161 R = removed
162 ? = not tracked'''
162 ? = not tracked'''
163 (c, a, d, u) = repo.diffdir(repo.root, repo.current)
163 (c, a, d, u) = repo.diffdir(repo.root)
164 (c, a, d, u) = map(lambda x: relfilter(repo, x), (c, a, d, u))
164 (c, a, d, u) = map(lambda x: relfilter(repo, x), (c, a, d, u))
165
165
166 for f in c: print "C", f
166 for f in c: print "C", f
@@ -426,7 +426,7 b' class localrepository:'
426 else:
426 else:
427 self.warn("%s not tracked!\n")
427 self.warn("%s not tracked!\n")
428 else:
428 else:
429 (c, a, d, u) = self.diffdir(self.root, parent)
429 (c, a, d, u) = self.diffdir(self.root)
430 commit = c + a
430 commit = c + a
431 remove = d
431 remove = d
432
432
@@ -501,7 +501,7 b' class localrepository:'
501 self.dirstate.clear()
501 self.dirstate.clear()
502 self.dirstate.update([f for f,n in l], "n")
502 self.dirstate.update([f for f,n in l], "n")
503
503
504 def diffdir(self, path, changeset):
504 def diffdir(self, path, changeset = None):
505 changed = []
505 changed = []
506 added = []
506 added = []
507 unknown = []
507 unknown = []
@@ -510,11 +510,12 b' class localrepository:'
510 if changeset:
510 if changeset:
511 change = self.changelog.read(changeset)
511 change = self.changelog.read(changeset)
512 mf = self.manifest.read(change[0])
512 mf = self.manifest.read(change[0])
513
513 dc = dict.fromkeys(mf)
514 if changeset == self.current:
514 else:
515 changeset = self.dirstate.parents()[0]
516 change = self.changelog.read(changeset)
517 mf = self.manifest.read(change[0])
515 dc = self.dirstate.copy()
518 dc = self.dirstate.copy()
516 else:
517 dc = dict.fromkeys(mf)
518
519
519 def fcmp(fn):
520 def fcmp(fn):
520 t1 = file(os.path.join(self.root, fn)).read()
521 t1 = file(os.path.join(self.root, fn)).read()
@@ -535,7 +536,7 b' class localrepository:'
535 if not c:
536 if not c:
536 if fcmp(fn):
537 if fcmp(fn):
537 changed.append(fn)
538 changed.append(fn)
538 if c[0] == 'i':
539 elif c[0] == 'i':
539 if fn not in mf:
540 if fn not in mf:
540 added.append(fn)
541 added.append(fn)
541 elif fcmp(fn):
542 elif fcmp(fn):
General Comments 0
You need to be logged in to leave comments. Login now