[Bug 6182] New: changelog and manifest file timestamps are not kept up to date on Windows.

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Sat Aug 3 04:53:53 EDT 2019


https://bz.mercurial-scm.org/show_bug.cgi?id=6182

            Bug ID: 6182
           Summary: changelog and manifest file timestamps are not kept up
                    to date on Windows.
           Product: Mercurial
           Version: 4.9
          Hardware: PC
                OS: Windows
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: mrw at eandem.co.uk
                CC: mercurial-devel at mercurial-scm.org

This was noticed using the standalone web server viewing a tree of repositories
on a Windows box.  Each repository's last modified date is a lot older than the
last actual update to the repo.

My investigation led me to find that the last modified date shown by the web
server is based on the 00changelog.i file in the .hg/store directory.  Checking
the last write date for this file shows that the web server is correctly
reporting the last modified date based on this file.

Testing with a trial repo with a changelog file several weeks old and
committing a new change shows that the changelog file last write date advances
by one second from the previous date, it is not updated to the date and time
that the commit happens.

This appears to be the result of the call avoidambig() in util.py.  I
temporarily modified this function to call os.utime(path, None) and the last
write date on the changelog file was updated to the current date time on a
commit.  I tried to work why it was using just adding one second to the
original mtime and not a current date time but got lost in a maze of twisty
little passages, sorry.

I investigated this using 4.9.1 as that was the last Python module install
available for Windows that I am aware of.  I have checked that the behaviour
has not changed with a MSI install of 5.1 on a different Windows box.  The
issue does not occur on the various unixen I have access to.

Here is a simple sequence to show that the changelog and manifest file times
are only being advanced by 1 second.  The file system is Windows NTFS.

PS F:\hg\utime> hg init                                                        
                                                                               
                    PS F:\hg\utime> echo "hi" > a                              
                                                                               
                                        PS F:\hg\utime> hg commit -Am "init"   
                                                                               
                                                            adding a
PS F:\hg\utime> gci .hg\store\*.i | select Name,LastWriteTime                   
Name          LastWriteTime
----          -------------
00changelog.i 03/08/2019 13:42:22
00manifest.i  03/08/2019 13:42:23


PS F:\hg\utime> date                                                            
03 August 2019 13:43:01


PS F:\hg\utime> echo " world" >> a                                             
                                                                               
                    PS F:\hg\utime> hg commit -m "more"                        
                                                                               
                                        PS F:\hg\utime> gci .hg\store\*.i |
select Name,LastWriteTime                                                       
Name          LastWriteTime
----          -------------
00changelog.i 03/08/2019 13:42:23
00manifest.i  03/08/2019 13:42:24

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list