Changeset 59aa1a92d3fe…
Parent 5fb8cb474d54…
by
Changes to 8 files · Browse files at 59aa1a92d3fe Showing diff from parent 5fb8cb474d54 Diff from another changeset...
@@ -19,9 +19,8 @@
#include "Dirstatecache.h"
#include "dirstate.h"
-#include "Winstat64.h"
#include "Thgstatus.h"
-
+#include "Winstat.h"
std::list<Dirstatecache::E>& Dirstatecache::cache()
{
@@ -45,7 +44,7 @@ break;
}
- Winstat64 stat;
+ Winstat stat;
std::string path = hgroot + (usekbfiles ? "\\.hg\\kilnbfiles\\dirstate"
: "\\.hg\\dirstate");
@@ -54,7 +53,7 @@
if (iter == cache().end())
{
- if (stat.lstat(path.c_str()) != 0)
+ if (stat.lstat(path.c_str(), true) != 0)
{
TDEBUG_TRACE("Dirstatecache::get: lstat(" << path <<") failed");
return 0;
@@ -81,7 +80,7 @@
if (!new_stat && tc - iter->tickcount > 500)
{
- if (0 != stat.lstat(path.c_str()))
+ if (0 != stat.lstat(path.c_str(), true))
{
TDEBUG_TRACE("Dirstatecache::get: lstat(" << path <<") failed");
TDEBUG_TRACE("Dirstatecache::get: dropping " << iter->hgroot);
|
@@ -22,7 +22,6 @@ #include "DirectoryStatus.h"
#include "Dirstatecache.h"
#include "Winstat.h"
-#include "Winstat64.h"
#include "TortoiseUtils.h"
#include "Thgstatus.h"
@@ -96,8 +95,8 @@ {
p.resize(pos);
p += "\\.hg\\kilnbfiles\\dirstate";
- Winstat64 stat;
- if (stat.lstat(p.c_str()) == 0)
+ Winstat stat;
+ if (stat.lstat(p.c_str(), true) == 0)
{
// ignore files and dirs named '.kbf' when kbfiles is enabled
last = cur;
|
@@ -214,7 +214,6 @@ <ClCompile Include="TortoiseIconBitmap.cpp" />
<ClCompile Include="TortoiseUtils.cpp" />
<ClCompile Include="Winstat.cpp" />
- <ClCompile Include="Winstat64.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="CShellExtCMenu.h" />
@@ -242,7 +241,6 @@ <ClInclude Include="TortoiseIconBitmap.h" />
<ClInclude Include="TortoiseUtils.h" />
<ClInclude Include="Winstat.h" />
- <ClInclude Include="Winstat64.h" />
</ItemGroup>
<ItemGroup>
<None Include="ShellExt.def" />
|
@@ -81,9 +81,6 @@ <ClCompile Include="Winstat.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="Winstat64.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="CShellExtCMenu.h">
@@ -161,9 +158,6 @@ <ClInclude Include="Winstat.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="Winstat64.h">
- <Filter>Header Files</Filter>
- </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="ShellExt.def">
|
@@ -1,4 +1,4 @@ -
+// Copyright (C) 2011 Fog Creek Software
// Copyright (C) 2009 Benjamin Pollack
//
// This program is free software: you can redistribute it and/or modify
@@ -19,7 +19,7 @@#include "Winstat.h"
-int Winstat::lstat(const char* file)
+int Winstat::lstat(const char* file, bool time64)
{
const __int64 days_between_epochs = 134774L; /* days between 1.1.1601 and 1.1.1970 */
const __int64 secs_between_epochs = (__int64)days_between_epochs * 86400L;
@@ -34,7 +34,12 @@ FindClose(hfind);
this->mtime = (((__int64)data.ftLastWriteTime.dwHighDateTime << 32) +
- data.ftLastWriteTime.dwLowDateTime) / divisor - secs_between_epochs;
+ data.ftLastWriteTime.dwLowDateTime);
+ if (!time64)
+ {
+ mtime /= divisor;
+ mtime -= secs_between_epochs;
+ }
this->size = ((__int64)data.nFileSizeHigh << 32) + data.nFileSizeLow;
this->isdir = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
|
@@ -1,4 +1,4 @@ -
+// Copyright (C) 2011 Fog Creek Software
// Copyright (C) 2009 Benjamin Pollack
//
// This program is free software: you can redistribute it and/or modify
@@ -24,7 +24,7 @@ unsigned __int64 mtime;
bool isdir;
- int lstat(const char* file);
+ int lstat(const char* file, bool time64 = false);
};
#endif
|
|
@@ -1,36 +0,0 @@ -
-// Copyright (C) 2009 Adrian Buehlmann
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#include "stdafx.h"
-
-#include "Winstat64.h"
-
-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 = ((__int64)data.ftLastWriteTime.dwHighDateTime << 32)
- + data.ftLastWriteTime.dwLowDateTime;
- this->size = ((__int64)data.nFileSizeHigh << 32) + data.nFileSizeLow;
-
- return 0;
-}
|
|
@@ -1,27 +0,0 @@ -
-// Copyright (C) 2009 Adrian Buehlmann
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef WINSTAT64_H
-#define WINSTAT64_H
-
-struct Winstat64
-{
- __int64 mtime;
- __int64 size;
- int lstat(const char* path);
-};
-
-#endif
|
Loading...