mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-01 06:12:23 -06:00
ide: repo improvements
git-svn-id: svn://ultimatepp.org/upp/trunk@15628 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
132a7cf654
commit
7ac5740bae
1 changed files with 26 additions and 1 deletions
|
|
@ -130,6 +130,7 @@ String GitCmd(const char *dir, const char *command)
|
|||
SetCurrentDirectory(dir);
|
||||
String r = RepoSys(String() << "git " << command);
|
||||
SetCurrentDirectory(h);
|
||||
DDUMP(r);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
@ -336,6 +337,19 @@ void RepoMoveSvn(const String& path, const String& tp)
|
|||
}
|
||||
}
|
||||
|
||||
String GetGitUrl(const String& repo_dir)
|
||||
{
|
||||
Vector<String> ln = Split(GitCmd(repo_dir, "config --get remote.origin.url"), CharFilterCrLf);
|
||||
return ln.GetCount() ? ln[0] : String();
|
||||
}
|
||||
|
||||
|
||||
String GetSvnUrl(const String& repo_dir)
|
||||
{
|
||||
Vector<String> ln = Split(RepoSys("svn info --show-item repos-root-url " + repo_dir), CharFilterCrLf);
|
||||
return ln.GetCount() ? ln[0] : String();
|
||||
}
|
||||
|
||||
void RepoSync::DoSync()
|
||||
{
|
||||
SyncList();
|
||||
|
|
@ -365,11 +379,22 @@ again:
|
|||
UrepoConsole sys;
|
||||
int repoi = 0;
|
||||
int l = 0;
|
||||
String repo_dir;
|
||||
while(l < list.GetCount()) {
|
||||
SvnOptions *svn = dynamic_cast<SvnOptions *>(list.GetCtrl(l, 0));
|
||||
GitOptions *git = dynamic_cast<GitOptions *>(list.GetCtrl(l, 0));
|
||||
String repo_dir = work[repoi++].dir;
|
||||
String url;
|
||||
if(git) {
|
||||
url = GetGitUrl(repo_dir);
|
||||
if(url.GetCount())
|
||||
sys.Log("git origin url: " + url, Gray());
|
||||
|
||||
}
|
||||
if(svn) {
|
||||
url = GetGitUrl(repo_dir);
|
||||
if(url.GetCount())
|
||||
sys.Log("svn repository url: " + url, Gray());
|
||||
}
|
||||
l++;
|
||||
String message;
|
||||
String filelist; // <-- list of files to update
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue