changeset 18784:a12798938721

largefiles: don't query the dirstate for key None lfutil.splitstandin(f) can be None, and we query the dirstate for that without checking if it is. This will cause problems with the upcoming move to critbit- based dicts, since they only support strings as keys.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 19 Mar 2013 13:49:34 -0700
parents b99e62a9b7a2
children 136516cd3d69
files hgext/largefiles/overrides.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Mon Mar 18 19:59:05 2013 -0500
+++ b/hgext/largefiles/overrides.py	Tue Mar 19 13:49:34 2013 -0700
@@ -374,10 +374,13 @@
         f, m, args, msg = action
 
         choices = (_('&Largefile'), _('&Normal file'))
-        if m == "g" and lfutil.splitstandin(f) in p1 and f in p2:
+
+        splitstandin = lfutil.splitstandin(f)
+        if (m == "g" and splitstandin is not None and
+            splitstandin in p1 and f in p2):
             # Case 1: normal file in the working copy, largefile in
             # the second parent
-            lfile = lfutil.splitstandin(f)
+            lfile = splitstandin
             standin = f
             msg = _('%s has been turned into a largefile\n'
                     'use (l)argefile or keep as (n)ormal file?') % lfile