SCM driver reports if system tracks directories

This can be used to make decisions about whether or not we should assign a virtual status to directories, prune them from a status display, or similar.
This commit is contained in:
Allan Odgaard
2012-09-03 11:13:29 +02:00
parent c30c24071e
commit 217dce5477
4 changed files with 9 additions and 4 deletions

View File

@@ -13,7 +13,8 @@ namespace scm
virtual std::string branch_name (std::string const& wcPath) const = 0;
virtual status_map_t status (std::string const& wcPath) const = 0;
std::string const& name () const { return _name; }
std::string const& name () const { return _name; }
virtual bool tracks_directories () const { return false; }
protected:
std::string const& executable () const { return _resolved_executable; }

View File

@@ -135,6 +135,8 @@ namespace scm
return res;
}
bool tracks_directories () const { return true; }
private:
std::string _xslt_path = NULL_STR;
};

View File

@@ -89,9 +89,10 @@ namespace scm
ASSERTF(path::is_directory(_wc_path) || !path::exists(_wc_path) || _wc_path == NULL_STR, "Path: %s\n", _wc_path.c_str());
}
std::string info_t::scm_name () const { return _driver->name(); }
std::string info_t::path () const { return _wc_path; }
std::string info_t::branch () const { return _driver->branch_name(_wc_path); }
std::string info_t::scm_name () const { return _driver->name(); }
std::string info_t::path () const { return _wc_path; }
std::string info_t::branch () const { return _driver->branch_name(_wc_path); }
bool info_t::tracks_directories () const { return _driver->tracks_directories(); }
status::type info_t::status (std::string const& path)
{

View File

@@ -31,6 +31,7 @@ namespace scm
std::string scm_name () const;
std::string path () const;
std::string branch () const;
bool tracks_directories () const;
status::type status (std::string const& path);
status_map_t files_with_status (int mask);