|
|
Home » Developing U++ » UppHub » usvn - SVN for dummies (and me)
usvn - SVN for dummies (and me) [message #17222] |
Sun, 03 August 2008 12:27 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
I have created a simple svn automation GUI frontend "usvn".
Well, what is does is in principle that it replicates (and a bit improves) uvs2 mode of operation:
- there is only a single button, "Synchronize", capable of commiting and updating several working directories
- you can remove, copy, rename or add files without those pesky svn commands. usvn should take care about all of them.... (but it is still 'alpha', of course Means, do whatever you want, usvn will keep you in sync....
You can use it in two modes. If you specify a working directory or directories on commandline, it will sync them. Otherwise, it will sync a list of directories stored in configuration and managed by usvn.
Now commited to bazaar using itself
(you have to have 'svn' command-line installed for it to work)
Mirek
|
|
|
|
|
|
Re: usvn - SVN for dummies (and me) [message #18109 is a reply to message #18079] |
Wed, 10 September 2008 19:17 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
captainc wrote on Tue, 09 September 2008 16:12 | What are the command line arguments for usvn? what is the configuration file structure?
What about putting a button that lets you choose a svn working directory to sync?
|
Uhm, let us say it is still work in progress.
Originally I have inteded to have a set of working directories that get synchronized in single step.
However, meanwhile I had to do a lot of commandline / bash work in Linux. Since then, I have changed usvn to "GUI with commandline" application, as it is the most practical.
Most often I call it for the current directory, which involves no parameters at all. Alternatively, you can put a set of directories on commandline.
Mirek
[Updated on: Wed, 10 September 2008 19:18] Report message to a moderator
|
|
|
|
Re: usvn - SVN for dummies (and me) [message #26328 is a reply to message #26234] |
Sun, 25 April 2010 11:29 |
|
ktj9 wrote on Fri, 16 April 2010 06:31 | Having been playing with it for a day. Very handy! Just need a "Skip" functionality, so I can skip those I don't want to commit.
To do that, hacks that I made are:
Change to this in SvnSync ctor
list.ColumnWidths("220 500 100");
Change to this in SvnSync::SyncList()
list.SetCtrl(ii, 0, revert.Add().SetLabel("Revert\n" + an + "\nSkip").NoWantFocus());
Change to this in SvnSync::DoSync()
bool commit = false;
while(l < list.GetCount()) {
SvnWork w = works[repoi++];
l++;
String message;
Value v0 = list.Get(l, 2);
if (IsNumber(v0) && (int)v0==2){
continue;
}
|
Hi kjt9!
Sorry it took so long before anyone respond... I guess nobody noticed your post because it is in rather old thread.
I fully agree that ability to skip files in usvn would be very helpful. I am the kind of person who works on several things at the same time, so I am dealing with it all the time. I tested the code changes you proposed. Unfortunately the patch you propose is not working correctly in some cases. It is fine for adding and deleting files, but when it comes to modifications, it was skipping everything.
So while I was debugging your code, I actually wrote my own patch. I kept the first two snipets (the UI stuff), but the changed part of Svn::DoSync() should look like this: ...
bool commit = false;
while(l < list.GetCount()) {
SvnWork w = works[repoi++];
l++;
String message;
String filelist;
while(l < list.GetCount()) {
int action = list.Get(l, 0);
String path = list.Get(l, 1);
if(action == MESSAGE && commit) {
String msg = list.Get(l, 3);
if(sys.CheckSystem(SvnCmd("commit", w).Cat() << filelist << " -m \"" << msg << "\""))
msgmap.GetAdd(w.working) = msg;
l++;
break;
}
if(action == REPOSITORY)
break;
Value v = list.Get(l, 2);
if(IsNumber(v) && (int)v == 0) {
if(action == REPLACE || action == ADD)
DeleteFolderDeep(path);
if(action != ADD)
sys.CheckSystem("svn revert " + path);
}else if(IsNumber(v)&&(int)v==2){
l++;
continue;
}
else {
...
I hope this time someone notices this post ... and possibly applies the patch.
Best regards
Honza
|
|
|
|
Re: usvn - SVN for dummies (and me) [message #26515 is a reply to message #26507] |
Fri, 07 May 2010 13:47 |
|
ktj9 wrote on Thu, 06 May 2010 23:26 | Hello Honza,
Thank you for pointing out an issue. Would you please indicate where and how you update the String filelist? Thanks!
|
Oups, I truncated the code too early, I'm sorry
Here is the full function code: void SvnSync::DoSync()
{
SyncList();
msgmap.Sweep();
again:
if(Execute() != IDOK || list.GetCount() == 0) {
int repoi = 0;
for(int i = 0; i < list.GetCount(); i++)
if(list.Get(i, 0) == MESSAGE)
msgmap.GetAdd(works[repoi++].working) = list.Get(i, 3);
return;
}
bool changes = false;
for(int i = 0; i < list.GetCount(); i++) {
int action = list.Get(i, 0);
Value v = list.Get(i, 2);
if(action == MESSAGE) {
if(changes && IsNull(list.Get(i, 3))
&& !PromptYesNo("Commit message is empty.&Do you want to continue?"))
goto again;
changes = false;
}
else if(action != REPOSITORY && IsNumber(v) && (int)v)
changes = true;
}
SysConsole sys;
int repoi = 0;
int l = 0;
bool commit = false;
while(l < list.GetCount()) {
SvnWork w = works[repoi++];
l++;
String message;
String filelist; // <-- list of files to update
while(l < list.GetCount()) {
int action = list.Get(l, 0);
String path = list.Get(l, 1);
if(action == MESSAGE && commit) {
String msg = list.Get(l, 3);
// now we commit only files in filelist
if(sys.CheckSystem(SvnCmd("commit", w).Cat() << filelist << " -m \"" << msg << "\""))
msgmap.GetAdd(w.working) = msg;
l++;
break;
}
if(action == REPOSITORY)
break;
Value v = list.Get(l, 2);
if(IsNumber(v) && (int)v == 0) {
if(action == REPLACE || action == ADD)
DeleteFolderDeep(path);
if(action != ADD)
sys.CheckSystem("svn revert " + path);
}else if(IsNumber(v)&&(int)v==2){ // <-- the file should be skipped
l++;
continue;
}
else {
filelist+=" "+path; // <-- add the file to the list
commit = true;
switch(action) {
case ADD:
SvnDel(path);
sys.CheckSystem("svn add --force " + path);
break;
case REMOVE:
sys.CheckSystem("svn delete " + path);
break;
case CONFLICT:
sys.CheckSystem("svn resolved " + path);
break;
case REPLACE: {
SvnDel(path);
String tp = AppendFileName(GetFileFolder(path), Format(Uuid::Create()));
FileMove(path, tp);
sys.CheckSystem(SvnCmd("update", w).Cat() << ' ' << path);
MoveSvn(path, tp);
sDeleteFolderDeep(path);
FileMove(tp, path);
Vector<String> ln = Split(Sys("svn status " + path), CharFilterCrLf);
for(int l = 0; l < ln.GetCount(); l++) {
String h = ln[l];
if(h.GetCount() > 7) {
String file = h.Mid(7);
if(IsFullPath(file)) {
h.Trim(7);
if(h == "? ")
sys.CheckSystem("svn add --force " + file);
if(h == "! ")
sys.CheckSystem("svn delete " + file);
}
}
}
}
break;
case DELETEC:
FileDelete(path);
break;
}
}
l++;
}
sys.CheckSystem(SvnCmd("update", w).Cat() << w.working);
}
sys.Perform();
}
Best regards,
Hozna
|
|
|
|
Goto Forum:
Current Time: Mon May 06 03:52:31 CEST 2024
Total time taken to generate the page: 0.01849 seconds
|
|
|