diff --git a/uppsrc/ide/UppWspc.cpp b/uppsrc/ide/UppWspc.cpp index e60ebaa5b..1a9c4ea9e 100644 --- a/uppsrc/ide/UppWspc.cpp +++ b/uppsrc/ide/UppWspc.cpp @@ -302,7 +302,8 @@ Vector WorkspaceWork::RepoDirs(bool actual) d.Insert(0, GetFileFolder(PackagePath(actualpackage))); Vector r; for(int i = 0; i < d.GetCount(); i++) - r.Add(d[i]); + if(GetRepoKind(d[i])) + r.Add(d[i]); return r; } diff --git a/uppsrc/ide/ide.cpp b/uppsrc/ide/ide.cpp index 2f879c688..b2e4e04d4 100644 --- a/uppsrc/ide/ide.cpp +++ b/uppsrc/ide/ide.cpp @@ -676,5 +676,5 @@ void Ide::SvnHistory() { if(IsNull(editfile)) return; - RunSvnDiff(editfile); + RunRepoDiff(editfile); } diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index c2fb504e1..0d274f8e2 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -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; diff --git a/uppsrc/ide/ide.key b/uppsrc/ide/ide.key index 1819cafbd..8e5bfbe5c 100644 --- a/uppsrc/ide/ide.key +++ b/uppsrc/ide/ide.key @@ -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) diff --git a/uppsrc/ide/idebar.cpp b/uppsrc/ide/idebar.cpp index c0dd03a29..dbf8f8ae0 100644 --- a/uppsrc/ide/idebar.cpp +++ b/uppsrc/ide/idebar.cpp @@ -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) diff --git a/uppsrc/ide/idefile.cpp b/uppsrc/ide/idefile.cpp index 2f23a33f0..2ecd6e379 100644 --- a/uppsrc/ide/idefile.cpp +++ b/uppsrc/ide/idefile.cpp @@ -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(); } diff --git a/uppsrc/ide/idewin.cpp b/uppsrc/ide/idewin.cpp index e15859fdd..3de37e00b 100644 --- a/uppsrc/ide/idewin.cpp +++ b/uppsrc/ide/idewin.cpp @@ -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; } diff --git a/uppsrc/urepo/Diff.cpp b/uppsrc/urepo/Diff.cpp index 81de4014d..2c1fbeb2d 100644 --- a/uppsrc/urepo/Diff.cpp +++ b/uppsrc/urepo/Diff.cpp @@ -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") diff --git a/uppsrc/urepo/RepoSync.cpp b/uppsrc/urepo/RepoSync.cpp index 61968a28f..f43ce2d94 100644 --- a/uppsrc/urepo/RepoSync.cpp +++ b/uppsrc/urepo/RepoSync.cpp @@ -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; }