Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

shellext: use high precision stat for dirstate cache

Changeset ac94736a89d9

Parent f6812c034a98

by Adrian Buehlmann

Changes to 2 files · Browse files at ac94736a89d9 Showing diff from parent f6812c034a98 Diff from another changeset...

 
29
30
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
33
34
 
40
41
42
43
 
44
45
46
 
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
66
67
68
 
69
70
71
72
@@ -29,6 +29,32 @@
 }     +struct Winstat64 +{ + __time64_t mtime; + __int64 size; + int lstat(const char* path); +}; + + +int Winstat64::lstat(const char* path) +{ + WIN32_FIND_DATAA data; + HANDLE hfind; + + hfind = FindFirstFileA(path, &data); + if (hfind == INVALID_HANDLE_VALUE) + return -1; + FindClose(hfind); + + this->mtime = *(__time64_t*)&data.ftLastWriteTime; + this->size = ((__int64)data.nFileSizeHigh << sizeof(data.nFileSizeHigh)) + | data.nFileSizeLow; + + return 0; +} + +  Dirstate* Dirstatecache::get(const std::string& hgroot)  {   typedef std::list<E>::iterator Iter; @@ -40,7 +66,7 @@
  break;   }   - Winstat stat; + Winstat64 stat;   std::string path = hgroot + "\\.hg\\dirstate";     unsigned tc = GetTickCount();
 
29
30
31
32
 
33
34
35
 
29
30
31
 
32
33
34
35
@@ -29,7 +29,7 @@
  {   Dirstate* dstate;   __time64_t dstate_mtime; - unsigned dstate_size; + __int64 dstate_size;     std::string hgroot;   unsigned tickcount;