Ticket #5291: trac-5291.2.patch

File trac-5291.2.patch, 934 bytes (added by TimothyClemans, 12 years ago)
  • sage/server/notebook/worksheet.py

    # HG changeset patch
    # User Timothy Clemans <timothy.clemans@gmail.com>
    # Date 1234908027 18000
    # Node ID 7ffd74c4463e5de2c9a8543c19663c2d07a827f1
    # Parent  6cbe9a1160c4d8744fda36a0f6fa7d1a9529b52c
    #5291
    
    diff -r 6cbe9a1160c4 -r 7ffd74c4463e sage/server/notebook/worksheet.py
    a b  
    16651665        t = time.time()           
    16661666        if t - last >= self.user_autosave_interval(username):
    16671667            self.__last_autosave = t
    1668             self.save_snapshot(username)
     1668            current = self.edit_text()
     1669            filename = '%s/worksheet.txt'%(self.__dir)
     1670            old = open(filename).read()
     1671            if not current == old:
     1672                self.save_snapshot(username, current)
    16691673
    16701674    def revert_to_snapshot(self, name):
    16711675        path = self.snapshot_directory()