comparison mercurial/localrepo.py @ 1617:ece5d785e87a

Make localrepo.changes() internally distinguish between removed and deleted.
author Thomas Arendsen Hein <thomas@intevation.de>
date Thu, 12 Jan 2006 12:22:28 +0100
parents f0f9e84849e7
children ff339dd21976
comparison
equal deleted inserted replaced
1616:f0f9e84849e7 1617:ece5d785e87a
499 if not node2: 499 if not node2:
500 try: 500 try:
501 wlock = self.wlock(wait=0) 501 wlock = self.wlock(wait=0)
502 except lock.LockHeld: 502 except lock.LockHeld:
503 wlock = None 503 wlock = None
504 lookup, modified, added, deleted, unknown = ( 504 lookup, modified, added, removed, deleted, unknown = (
505 self.dirstate.changes(files, match)) 505 self.dirstate.changes(files, match))
506 506
507 # are we comparing working dir against its parent? 507 # are we comparing working dir against its parent?
508 if not node1: 508 if not node1:
509 if lookup: 509 if lookup:
518 # we are comparing working dir against non-parent 518 # we are comparing working dir against non-parent
519 # generate a pseudo-manifest for the working dir 519 # generate a pseudo-manifest for the working dir
520 mf2 = mfmatches(self.dirstate.parents()[0]) 520 mf2 = mfmatches(self.dirstate.parents()[0])
521 for f in lookup + modified + added: 521 for f in lookup + modified + added:
522 mf2[f] = "" 522 mf2[f] = ""
523 for f in deleted: 523 for f in removed:
524 if f in mf2: 524 if f in mf2:
525 del mf2[f] 525 del mf2[f]
526 else: 526 else:
527 # we are comparing two revisions 527 # we are comparing two revisions
528 unknown = [] 528 deleted, unknown = [], []
529 mf2 = mfmatches(node2) 529 mf2 = mfmatches(node2)
530 530
531 if node1: 531 if node1:
532 # flush lists from dirstate before comparing manifests 532 # flush lists from dirstate before comparing manifests
533 modified, added = [], [] 533 modified, added = [], []
540 modified.append(fn) 540 modified.append(fn)
541 del mf1[fn] 541 del mf1[fn]
542 else: 542 else:
543 added.append(fn) 543 added.append(fn)
544 544
545 deleted = mf1.keys() 545 removed = mf1.keys()
546
547 removed.extend(deleted) #XXX get rid of this when returning deleted
546 548
547 # sort and return results: 549 # sort and return results:
548 for l in modified, added, deleted, unknown: 550 for l in modified, added, removed, unknown:
549 l.sort() 551 l.sort()
550 return (modified, added, deleted, unknown) 552 return (modified, added, removed, unknown)
551 553
552 def add(self, list): 554 def add(self, list):
553 wlock = self.wlock() 555 wlock = self.wlock()
554 for f in list: 556 for f in list:
555 p = self.wjoin(f) 557 p = self.wjoin(f)