ide: urepo

git-svn-id: svn://ultimatepp.org/upp/trunk@11357 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-10-08 20:58:04 +00:00
parent 1f95d4c13c
commit 71b0f46e62
9 changed files with 18 additions and 14 deletions

View file

@ -302,7 +302,8 @@ Vector<String> WorkspaceWork::RepoDirs(bool actual)
d.Insert(0, GetFileFolder(PackagePath(actualpackage)));
Vector<String> r;
for(int i = 0; i < d.GetCount(); i++)
r.Add(d[i]);
if(GetRepoKind(d[i]))
r.Add(d[i]);
return r;
}

View file

@ -676,5 +676,5 @@ void Ide::SvnHistory()
{
if(IsNull(editfile))
return;
RunSvnDiff(editfile);
RunRepoDiff(editfile);
}

View file

@ -474,7 +474,7 @@ public:
String editfile;
FileTime edittime;
int editfile_line_endings;
bool editfile_svn;
int editfile_repo;
bool editfile_isfolder;
String editfile_includes;

View file

@ -119,7 +119,7 @@ KEY(UNCOMMENT, "Uncomment code", K_CTRL_K|K_ALT_K)
KEY(REFORMAT_COMMENT, "Reformat comment paragraph", K_ALT_R)
KEY(DIFF, "Compare with file..", 0)
KEY(SVNDIFF, "Show svn history of file..", 0)
KEY(SVNDIFF, "Show repository history of file..", 0)
KEY(PATCH, "Patch/diff..", 0)
KEY(DIRDIFF, "Compare directories..", 0)

View file

@ -463,9 +463,11 @@ void Ide::FilePropertiesMenu(Bar& menu)
.Help("Show differences between the project and arbitrary files");
menu.AddMenu(IsActiveFile() && !editfile_isfolder && !designer, AK_PATCH, IdeImg::Patch(), THISBACK(Patch))
.Help("Show differences with patch file applied");
if(editfile_svn)
if(editfile_repo) {
String txt = String("Show ") + (editfile_repo == SVN_DIR ? "svn" : "git") + " history of file";
menu.AddMenu(IsActiveFile() && !editfile_isfolder && !designer, AK_SVNDIFF, IdeImg::SvnDiff(), THISBACK(SvnHistory))
.Help("Show svn history of file");
.Text(txt + "..").Help(txt);
}
}
void Ide::BuildFileMenu(Bar& menu)

View file

@ -381,7 +381,8 @@ void Ide::FlushFile() {
if(!editfile.IsEmpty())
Filedata(editfile).undodata = editor.PickUndoData();
editfile.Clear();
editfile_svn = editfile_isfolder = false;
editfile_repo = NOT_REPO_DIR;
editfile_isfolder = false;
repo_dirs = RepoDirs(true).GetCount(); // Perhaps not the best place, but should be ok
editor.Clear();
editor.Disable();
@ -561,7 +562,7 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c
editor.CheckEdited(true);
editor.Annotate(editfile);
editor.SyncNavigator();
editfile_svn = IsSvnDir(GetFileFolder(editfile));
editfile_repo = GetRepoKind(editfile);
editfile_includes = IncludesMD5();
}

View file

@ -638,7 +638,8 @@ Ide::Ide()
editor.WhenUpdate = THISBACK(TriggerAssistSync);
editfile_isfolder = editfile_svn = false;
editfile_isfolder = false;
editfile_repo = NOT_REPO_DIR;
auto_rescan = auto_check = true;
}

View file

@ -81,8 +81,10 @@ void RepoDiff::Execute(const String& f)
else
if(s.GetCount() >= 2) {
String k = ToLower(s[0]);
if(k == "author:")
author = s[1];
if(k == "author:") {
s.Remove(0);
author = Join(s, " ");
}
if(k == "date:")
date = s[1];
if(k == "commit")

View file

@ -97,13 +97,10 @@ bool RepoSync::ListSvn(const String& path)
String GitCmd(const char *dir, const char *command)
{
DDUMP(dir);
DDUMP(command);
String h = GetCurrentDirectory();
SetCurrentDirectory(dir);
String r = Sys(String() << "git " << command);
SetCurrentDirectory(h);
DDUMP(r);
return r;
}