Commits

Friedrich Kastner-Masilko committed 6ea28b2

fixed timestamp for empty match object

Comments (0)

Files changed (1)

                     tsdict[fname] = float(-1)
                     tslist.append(fname)
 
-        matchfiles=matchin.files()
-        if len(matchfiles)>0:            
-            match = matchfiles
+        if matchin and len(matchin.files())>0:            
+            match = matchin.files()
         else:
             modified, added, removed, deleted, unknown, ignored, clean = [
                 n for n in repo.status()]
 
         changed = False
         for f in match:
-            if f in tsdict and matchin(f):
+            if f in tsdict and ((not matchin) or matchin(f)):
                 fname = repo.wjoin(f)
                 stamp = tsdict[f] = float(os.stat(fname).st_mtime)
                 repo.ui.debug(time.strftime("%d.%m.%Y %H:%M:%S", time.localtime(stamp)), " \t", f, "\n")
                     pm.write("%s\n" % fname)
                 else:                    
                     pm.write("%s,%s\n" % (fname, tsdict[fname]))
-            if matchin('.hgtimestamp'):
+            if (not matchin) or matchin('.hgtimestamp'):
                 pass
             else:
                 def matchfn(fn):
                         return matchin.timestamp_origmatchfn(fn)
                 matchin.timestamp_origmatchfn=matchin.matchfn
                 matchin.matchfn=matchfn
-                if (len(matchfiles)>0):
-                    matchfiles.append('.hgtimestamp')
+                if (len(matchin.files())>0):
+                    matchin.files().append('.hgtimestamp')
             pm.close()
         else:
             repo.ui.debug(_('No tracked timestamp\n'))