Commits

Friedrich Kastner-Masilko  committed 8d5c6b6

Fixed bug in preprecommit (returning commit result now).

  • Participants
  • Parent commits 9d33f55

Comments (0)

Files changed (1)

File timestamp.py

                 tsdict[fname] = float(-1)
                 tslist.append(fname)
 
-    modified, added, removed, deleted, unknown, ignored, clean = [
-        n for n in repo.status()]
-    patched = modified + added
-    
     if opts['save']:
+        modified, added, removed, deleted, unknown, ignored, clean = [
+            n for n in repo.status(clean=True)]
+        patched = modified + added + clean
         changed = False
         ui.status(_('Checking timestamps\n'))
         for f in patched:
                 else:                    
                     pm.write("%s,%s\n" % (fname, tsdict[fname]))
         else:
-            ui.status(_('No tracked timestamp modified\n'))
+            ui.status(_('No tracked timestamp\n'))
     elif opts['restore']:
         ui.status(_('Restoring timestamps\n'))
         for f, mtime in tsdict.items():
               _('hg timestamp [-s | -r]')),
 }
 
-def commit(repo, *args, **kwargs):
+def _commit(repo, *args, **kwargs):
     '''Hack to get a real precommit hook. One that allows to modify files e.g.
     The precommit hook is only called in localrepo.commit. I hope it is
     safe to only decorate localrepo.commit.
     if ignore:
         pass
     else:
-        repo.ui.status(_('Timestamping activated.\n'))
         tsdict= dict()
         tslist= list()
         for line in tsfile.readlines():
                     args[0].append('.hgtimestamp')
             pm.close()
                                             
-    repo.origcommit(*args, **kwargs)
+    return repo.timestamp_origcommit(*args, **kwargs)
 
-localrepo.localrepository.origcommit = localrepo.localrepository.commit
-localrepo.localrepository.commit = commit
+localrepo.localrepository.timestamp_origcommit = localrepo.localrepository.commit
+localrepo.localrepository.commit = _commit