merge with stable
authorMatt Mackall <mpm@selenic.com>
Mon, 04 Aug 2014 14:32:34 -0500
changeset 21992 6be1e1dbe6a0
parent 21989 bdb6d97f0a04 (current diff)
parent 21991 aca137619a45 (diff)
child 21993 284a8c9f74f3
merge with stable
mercurial/context.py
--- a/hgext/color.py	Sat May 31 16:48:29 2014 -0700
+++ b/hgext/color.py	Mon Aug 04 14:32:34 2014 -0500
@@ -562,8 +562,12 @@
         for l in label.split():
             style = _styles.get(l, '')
             for effect in style.split():
-                attr = mapcolor(w32effects[effect], attr)
-
+                try:
+                    attr = mapcolor(w32effects[effect], attr)
+                except KeyError:
+                    # w32effects could not have certain attributes so we skip
+                    # them if not found
+                    pass
         # hack to ensure regexp finds data
         if not text.startswith('\033['):
             text = '\033[m' + text
--- a/mercurial/context.py	Sat May 31 16:48:29 2014 -0700
+++ b/mercurial/context.py	Mon Aug 04 14:32:34 2014 -0500
@@ -1347,8 +1347,10 @@
             try:
                 # updating the dirstate is optional
                 # so we don't wait on the lock
+                # wlock can invalidate the dirstate, so cache normal _after_
+                # taking the lock
+                wlock = self._repo.wlock(False)
                 normal = self._repo.dirstate.normal
-                wlock = self._repo.wlock(False)
                 try:
                     for f in fixup:
                         normal(f)