Mercurial and Git clients can push and pull from this alias URL to interact with this repository. You can change to which repository an alias points by going to the Aliases link on the project page.
// 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 "DirectoryStatus.h"charDirectoryStatus::status(conststd::string&relpath)const{charres='C';booladded=false;boolmodified=false;for(V::const_iteratori=v_.begin();i!=v_.end();++i){constE&e=*i;if(e.path_.compare(0,relpath.length(),relpath)==0){if(e.status_=='m'||e.status_=='r'){modified=true;break;}if(e.status_=='a')added=true;}}if(modified)res='M';elseif(added)res='A';elseres='C';returnres;}intDirectoryStatus::read(conststd::string&hgroot){v_.clear();std::stringp=hgroot+"\\.hg\\thgstatus";FILE*f=fopen(p.c_str(),"rb");if(!f){TDEBUG_TRACE("DirectoryStatus::read: can't open '"<<p<<"'");return0;}charstate;std::vector<char>path(MAX_PATH);DirectoryStatus::Ee;while(fread(&state,sizeof(state),1,f)==1){e.status_=state;path.clear();chart;while(fread(&t,sizeof(t),1,f)==1&&t!='\n'){path.push_back(t);if(path.size()>1000)return0;}path.push_back(0);e.path_=&path[0];v_.push_back(e);}fclose(f);TDEBUG_TRACE("DirectoryStatus::read("<<hgroot<<"): done. "<<v_.size()<<" entries read");return1;}structCacheEntry{
std::string hgroot_;
DirectoryStatus ds_;
+ bool readfailed_; unsigned tickcount_;
- CacheEntry(): tickcount_(0) {};
+ CacheEntry(): readfailed_(false), tickcount_(0) {};
};
DirectoryStatus*DirectoryStatus::get(conststd::string&hgroot){staticCacheEntryce; unsigned tc = GetTickCount();
- if (ce.hgroot_ == hgroot && (tc - ce.tickcount_) < 2000)
-return&ce.ds_;
+ if (ce.hgroot_ != hgroot || (tc - ce.tickcount_) > 2000)
+ {+ce.hgroot_.clear();+ ce.readfailed_ = (ce.ds_.read(hgroot) == 0);
+ ce.hgroot_ = hgroot;+ ce.tickcount_ = GetTickCount();+ }- ce.hgroot_.clear();-- if (ce.ds_.read(hgroot) == 0)- return 0;--ce.hgroot_=hgroot;- ce.tickcount_ = GetTickCount();- return &ce.ds_;
+ return (ce.readfailed_?0: &ce.ds_);
}
Attach a Trello Card
Add a tag
Your session has expired
You are no longer logged in. Please log in and try your request again.
Filter RSS Feed
This RSS feed URL allows you to see the contents of your current filter using any feed reader.
This link includes a special authentication token. If you share the URL with anyone else, they can see this RSS feed's activity. You can disable these tokens when needed.
Your current filter is unsaved; changing it won't affect this RSS feed.