changeset 6817:cf319797d61c

minor status fixups
author Matt Mackall <mpm@selenic.com>
date Tue, 22 Jul 2008 13:00:22 -0500
parents d8159dd15db3
children 6e93fbd847ef
files mercurial/context.py mercurial/localrepo.py
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Sun Jul 20 21:51:13 2008 +0200
+++ b/mercurial/context.py	Tue Jul 22 13:00:22 2008 -0500
@@ -470,9 +470,8 @@
         self._text = text
         if date:
             self._date = util.parsedate(date)
-        else:
-            self._date = util.makedate()
-        self._user = user
+        if user:
+            self._user = user
         if parents:
             self._parents = [changectx(self._repo, p) for p in parents]
         if changes:
@@ -504,6 +503,12 @@
         if name == '_status':
             self._status = self._repo.status(unknown=True)
             return self._status
+        elif name == '_user':
+            self._user = self._repo.ui.username()
+            return self._user
+        elif name == '_date':
+            self._date = util.makedate()
+            return self._date
         if name == '_manifest':
             self._buildmanifest()
             return self._manifest
--- a/mercurial/localrepo.py	Sun Jul 20 21:51:13 2008 +0200
+++ b/mercurial/localrepo.py	Tue Jul 22 13:00:22 2008 -0500
@@ -968,6 +968,8 @@
         if working: # we need to scan the working dir
             s = self.dirstate.status(match, listignored, listclean, listunknown)
             cmp, modified, added, removed, deleted, unknown, ignored, clean = s
+            removed.sort()
+            deleted.sort()
 
             # check for any possibly clean files
             if parentworking and cmp:
@@ -1003,9 +1005,9 @@
                 # we are comparing working dir against non-parent
                 # generate a pseudo-manifest for the working dir
                 mf2 = mfmatches(self['.'])
-                mf2.flags = ctx2.flags # delay flag lookup
                 for f in cmp + modified + added:
                     mf2[f] = None
+                    mf2.set(f, ctx2.flags(f))
                 for f in removed:
                     if f in mf2:
                         del mf2[f]
@@ -1017,9 +1019,9 @@
             modified, added, clean = [], [], []
             for fn in util.sort(mf2):
                 if fn in mf1:
-                    if ((mf1[fn] != mf2[fn] and
-                        (mf2[fn] or ctx1[fn].cmp(ctx2[fn].data())))
-                        or mf1.flags(fn) != mf2.flags(fn)):
+                    if (mf1.flags(fn) != mf2.flags(fn) or
+                        (mf1[fn] != mf2[fn] and
+                         (mf2[fn] or ctx1[fn].cmp(ctx2[fn].data())))):
                         modified.append(fn)
                     elif listclean:
                         clean.append(fn)