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

Directory: new member path_ instead of basepath_

Changeset 0d28542b5ed2

Parent 313005ffe01e

by Adrian Buehlmann

Changes to 2 files · Browse files at 0d28542b5ed2 Showing diff from parent 313005ffe01e Diff from another changeset...

 
21
22
23
 
 
 
 
 
 
 
 
 
 
 
24
25
26
 
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
 
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 
160
161
162
 
 
 
 
 
 
 
 
 
 
 
 
163
164
165
@@ -21,6 +21,17 @@
 #include "Winstat.h"     +Directory::Directory( + Directory* p, const std::string& n, const std::string& basepath +): + parent_(p), name_(n), tickcount_(0), status_(-1) +{ + path_ = basepath; + if (!n.empty()) + path_ += "/" + n; +} + +  Directory::~Directory()  {   for (DirsT::iterator i = subdirs_.begin(); i != subdirs_.end(); ++i) @@ -149,18 +160,6 @@
 }     -std::string Directory::path() const -{ - if (basepath_.empty()) - return name_; - - if (name_.empty()) - return basepath_; - - return basepath_ + "/" + name_; -} - -  char Directory::status_imp(const std::string& hgroot)  {   bool added = false;
 
31
32
33
34
 
35
36
37
 
40
41
42
43
44
45
 
46
47
48
 
49
50
51
 
31
32
33
 
34
35
36
37
 
40
41
42
 
 
 
43
44
45
 
46
47
48
49
@@ -31,7 +31,7 @@
    Directory* const parent_;   const std::string name_; - const std::string basepath_; + std::string path_;     DirsT subdirs_;   FilesT files_; @@ -40,12 +40,10 @@
  char status_;    public: - Directory(Directory* p, const std::string& n, const std::string& basepath): - parent_(p), name_(n), basepath_(basepath), tickcount_(0), status_(-1) {} - + Directory(Directory* p, const std::string& n, const std::string& basepath);   ~Directory();   - std::string path() const; + const std::string& path() const { return path_; }     int add(const std::string& relpath, Direntry& e);