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

shellext: show overlay icons on directories

Note: with this version, 'add' wins over 'modified' (original behaviour
as imported from CuteHg)

Changeset ad0ae5321a32

Parent 68d1b473e75a

by Adrian Buehlmann

Changes to one file · Browse files at ad0ae5321a32 Showing diff from parent 68d1b473e75a Diff from another changeset...

 
75
76
77
78
79
80
81
82
83
 
88
89
90
91
 
92
93
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
96
97
 
75
76
77
 
 
 
78
79
80
 
85
86
87
 
88
89
 
 
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
@@ -75,9 +75,6 @@
    TDEBUG_TRACE("IsMemberOf: hgroot = " << hgroot);   - if (PathIsDirectory(path)) - return S_FALSE; -   size_t offset = hgroot.length();   if (path[offset] == '\\')   offset++; @@ -88,10 +85,27 @@
    char status = 0;   - if (!HgQueryDirstateFile(hgroot.c_str(), path, relpath, &status)) + if (PathIsDirectory(path))   { - TDEBUG_TRACE("IsMemberOf: HgQueryDirstateFile returns false"); - return S_FALSE; + if (!strlen(relpath)) + return S_FALSE; // don't show icon on repo root dir + + if (strncmp(relpath, ".hg", 3) == 0) + return S_FALSE; // don't descend into .hg dir + + if (!HgQueryDirstateDirectory(hgroot.c_str(), path, relpath, &status)) + { + TDEBUG_TRACE("IsMemberOf: HgQueryDirstateDirectory returns false"); + return S_FALSE; + } + } + else + { + if (!HgQueryDirstateFile(hgroot.c_str(), path, relpath, &status)) + { + TDEBUG_TRACE("IsMemberOf: HgQueryDirstateFile returns false"); + return S_FALSE; + }   }     TDEBUG_TRACE("IsMemberOf: status = " << status);