Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » TheIde doesn't detect svn properly
|
Re: TheIde doesn't detect svn properly [message #40018 is a reply to message #40011] |
Sun, 26 May 2013 18:37   |
|
Zbych wrote on Sun, 26 May 2013 13:44 | Hi,
I don't know if it is bug or feature, but when TheIde shows this context menu:

and it checks whether package has svn or not, it only scans $uppsrc and $MyApp directory. It doesn't check package directory at all. I usually have separate svn for every project and I can not synchronize my projects directly from TheIde.
|
Hi Zbych,
As far as I can tell, TheIDE does check currently selected package (comments added for clarity):
void Ide::ProjectSvn(Bar& menu)
{
Vector<String> w = SvnDirs(); // returns paths nests from current assembly, e.g. MyApps and uppsrc
String p = GetFileFolder(PackagePath(actualpackage)); // current package folder
if(IsSvnDir(p))
w.Insert(0, p); // inserts the package folder in the top position in the menu if
// it is inside a SVN working copy
for(int i = 0; i < w.GetCount(); i++) // create the actual menu items
menu.Add("Synchronize " + w[i], IdeImg::svn_dir(), THISBACK1(SyncSvnDir, w[i]));
menu.Add("Synchronize everything..", IdeImg::svn(), THISBACK(SyncSvn));
}
The IsSvnDir() function also seems to work properly. So, what exactly is the problem? Even in your screenshot I can see the item for syncing MultiIOTest (even though it is cropped ).
Best regards,
Honza
|
|
|
Re: TheIde doesn't detect svn properly [message #40020 is a reply to message #40018] |
Sun, 26 May 2013 19:11   |
Zbych
Messages: 327 Registered: July 2009
|
Senior Member |
|
|
Hi Honza,
It is hard to show something invisible, that's why I created fake ".svn" directory in $MyApps, to show what part of menu is missing 
Regarding missing SVN menu, as far as I know TheIde calls SvnDirs().GetCount() every time context menu is opened (in Ide::Project function).
SvnDirs takes list of directories to search from UPP environment variable (GetVar("UPP")) and I don't see main package directory on this list.
I added some logs to Ide::Project, Ide::SvnDirs and GetUppDirs.
Vector<String> GetUppDirs() {
RLOG("UPP VAR = " + GetVar("UPP"));
return SplitDirs(GetVar("UPP"));
}
Vector<String> Ide::SvnDirs()
{
Vector<String> d = GetUppDirs();
Vector<String> r;
for(int i = 0; i < d.GetCount(); i++){
RLOG("Checking " + d[i]);
if(IsSvnDir(d[i])){
RLOG("SVNDIR: " + d[i]);
r.Add(d[i]);
}else{
RLOG("NOT SVNDIR: " + d[i]);
}
}
return r;
}
Part of Ide::Project:
RLOG("------- SVN ----------------");
int c = SvnDirs().GetCount();
RLOG(Format("Found %d svn dirs", c));
if(c){
if(menu.IsMenuBar())
menu.Add("SVN", THISBACK(ProjectSvn));
else
menu.Add("SVN Synchronize everything..", IdeImg::svn(), THISBACK(SyncSvn));
}
------- SVN ----------------
UPP VAR = /media/1A1890EB1890C763/workspace;/home/zbych/upp/uppsrc;
Checking /media/1A1890EB1890C763/workspace
Directory '/media/1A1890EB1890C763/workspace/.svn' doesn't exist
NOT SVNDIR: /media/1A1890EB1890C763/workspace
Checking /home/zbych/upp/uppsrc
Directory '/home/zbych/upp/uppsrc/.svn' doesn't exist
NOT SVNDIR: /home/zbych/upp/uppsrc
Found 0 svn dirs
As you can see number of returned SVNs is 0 although there is ".svn" in the main package directory.
[Updated on: Sun, 26 May 2013 19:24] Report message to a moderator
|
|
|
Re: TheIde doesn't detect svn properly [message #40031 is a reply to message #40020] |
Mon, 27 May 2013 08:18   |
|
Zbych wrote on Sun, 26 May 2013 19:11 | It is hard to show something invisible, that's why I created fake ".svn" directory in $MyApps, to show what part of menu is missing 
| Well, that explains my confusion 
Zbych wrote on Sun, 26 May 2013 19:11 | Regarding missing SVN menu, as far as I know TheIde calls SvnDirs().GetCount() every time context menu is opened (in Ide::Project function).
| Ok, now I see the problem, this sentece opened my eyes It should be simple to fix. Can you try the attached patch please? It works fine for me, but I haven't tested it with your use-case... If it works well, I will commit it.
Honza
-
Attachment: svn.patch
(Size: 1.11KB, Downloaded 289 times)
|
|
|
|
|
|
|
Re: TheIde doesn't detect svn properly [message #40046 is a reply to message #40043] |
Tue, 28 May 2013 12:06  |
|
mirek wrote on Tue, 28 May 2013 09:57 | Patch is wrong for "Synchronize everything" - in my mode of operation, I now have current package in the list twice (once as part of nest, then alone).
Reverting, adding to RM...
Mirek
|
Sorry about that... I'll try to find out better solution.
Weird think is that I didn't notice the problem with "the nest is a working copy" mode. Is there anything special about your directory and svn organization?
Honza
|
|
|
Goto Forum:
Current Time: Tue May 13 10:56:22 CEST 2025
Total time taken to generate the page: 0.03879 seconds
|