mercurial/localrepo.py
changeset 6827 c978d6752dbb
parent 6817 cf319797d61c
child 6839 01db3e101362
equal deleted inserted replaced
6826:eca20fee0728 6827:c978d6752dbb
   966         listignored, listclean, listunknown = ignored, clean, unknown
   966         listignored, listclean, listunknown = ignored, clean, unknown
   967 
   967 
   968         if working: # we need to scan the working dir
   968         if working: # we need to scan the working dir
   969             s = self.dirstate.status(match, listignored, listclean, listunknown)
   969             s = self.dirstate.status(match, listignored, listclean, listunknown)
   970             cmp, modified, added, removed, deleted, unknown, ignored, clean = s
   970             cmp, modified, added, removed, deleted, unknown, ignored, clean = s
   971             removed.sort()
       
   972             deleted.sort()
       
   973 
   971 
   974             # check for any possibly clean files
   972             # check for any possibly clean files
   975             if parentworking and cmp:
   973             if parentworking and cmp:
   976                 fixup = []
   974                 fixup = []
   977                 # do a full compare of any files that might have changed
   975                 # do a full compare of any files that might have changed
   980                         or ctx1[f].cmp(ctx2[f].data())):
   978                         or ctx1[f].cmp(ctx2[f].data())):
   981                         modified.append(f)
   979                         modified.append(f)
   982                     else:
   980                     else:
   983                         fixup.append(f)
   981                         fixup.append(f)
   984 
   982 
   985                 modified.sort()
       
   986                 if listclean:
   983                 if listclean:
   987                     clean = util.sort(clean + fixup)
   984                     clean += fixup
   988 
   985 
   989                 # update dirstate for files that are actually clean
   986                 # update dirstate for files that are actually clean
   990                 if fixup:
   987                 if fixup:
   991                     wlock = None
   988                     wlock = None
   992                     try:
   989                     try:
  1015                 # we are comparing two revisions
  1012                 # we are comparing two revisions
  1016                 deleted, unknown, ignored = [], [], []
  1013                 deleted, unknown, ignored = [], [], []
  1017                 mf2 = mfmatches(ctx2)
  1014                 mf2 = mfmatches(ctx2)
  1018 
  1015 
  1019             modified, added, clean = [], [], []
  1016             modified, added, clean = [], [], []
  1020             for fn in util.sort(mf2):
  1017             for fn in mf2:
  1021                 if fn in mf1:
  1018                 if fn in mf1:
  1022                     if (mf1.flags(fn) != mf2.flags(fn) or
  1019                     if (mf1.flags(fn) != mf2.flags(fn) or
  1023                         (mf1[fn] != mf2[fn] and
  1020                         (mf1[fn] != mf2[fn] and
  1024                          (mf2[fn] or ctx1[fn].cmp(ctx2[fn].data())))):
  1021                          (mf2[fn] or ctx1[fn].cmp(ctx2[fn].data())))):
  1025                         modified.append(fn)
  1022                         modified.append(fn)
  1026                     elif listclean:
  1023                     elif listclean:
  1027                         clean.append(fn)
  1024                         clean.append(fn)
  1028                     del mf1[fn]
  1025                     del mf1[fn]
  1029                 else:
  1026                 else:
  1030                     added.append(fn)
  1027                     added.append(fn)
  1031             removed = util.sort(mf1.keys())
  1028             removed = mf1.keys()
  1032 
  1029 
  1033         return modified, added, removed, deleted, unknown, ignored, clean
  1030         r = modified, added, removed, deleted, unknown, ignored, clean
       
  1031         [l.sort() for l in r]
       
  1032         return r
  1034 
  1033 
  1035     def add(self, list):
  1034     def add(self, list):
  1036         wlock = self.wlock()
  1035         wlock = self.wlock()
  1037         try:
  1036         try:
  1038             rejected = []
  1037             rejected = []