fix AddNote, add Note object
This commit is contained in:
parent
1d5dd2a8b0
commit
a801f68340
|
@ -540,25 +540,27 @@ namespace SparkleLib {
|
||||||
|
|
||||||
public override void AddNote (string revision, string note)
|
public override void AddNote (string revision, string note)
|
||||||
{
|
{
|
||||||
string n = Environment.NewLine;
|
// Create the note in one line for easier merging
|
||||||
note = "<note>" + n +
|
note = "<note>" +
|
||||||
" <user>" + n +
|
" <user>" +
|
||||||
" <name>" + SparkleConfig.DefaultConfig.UserName + "</name>" + n +
|
" <name>" + SparkleConfig.DefaultConfig.UserName + "</name>" +
|
||||||
" <email>" + SparkleConfig.DefaultConfig.UserEmail + "</email>" + n +
|
" <email>" + SparkleConfig.DefaultConfig.UserEmail + "</email>" +
|
||||||
" </user>" + n +
|
" </user>" +
|
||||||
" <timestamp>" + (int) (DateTime.UtcNow - new DateTime (1970, 1, 1)).TotalSeconds + "</timestamp>" + n +
|
" <timestamp>" + (int) (DateTime.UtcNow - new DateTime (1970, 1, 1)).TotalSeconds + "</timestamp>" +
|
||||||
" <body>" + note + "</body>" + n +
|
" <body>" + note + "</body>" +
|
||||||
"</note>";
|
"</note>";
|
||||||
|
|
||||||
SparkleGit git = new SparkleGit (LocalPath, "notes append -m '" + note + "'");
|
SparkleGit git_notes = new SparkleGit (LocalPath, "notes append -m \"" + note + "\" " + revision);
|
||||||
git.Start ();
|
git_notes.Start ();
|
||||||
git.WaitForExit ();
|
git_notes.WaitForExit ();
|
||||||
|
|
||||||
while (Status != SyncStatus.Idle) {
|
while (Status != SyncStatus.Idle) {
|
||||||
System.Threading.Thread.Sleep (5 * 20);
|
System.Threading.Thread.Sleep (5 * 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
SyncUp ();
|
SparkleGit git_push = new SparkleGit (LocalPath, "git push origin refs/notes/*");
|
||||||
|
git_push.Start ();
|
||||||
|
git_push.WaitForExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,15 +24,29 @@ namespace SparkleLib {
|
||||||
|
|
||||||
public string UserName;
|
public string UserName;
|
||||||
public string UserEmail;
|
public string UserEmail;
|
||||||
|
|
||||||
public string Folder;
|
public string Folder;
|
||||||
public string Revision;
|
public string Revision;
|
||||||
public DateTime Timestamp;
|
public DateTime Timestamp;
|
||||||
|
public bool FolderSupportsNotes = false;
|
||||||
public bool IsMerge = false;
|
public bool IsMerge = false;
|
||||||
|
|
||||||
public List<string> Added = new List<string> ();
|
public List<string> Added = new List<string> ();
|
||||||
public List<string> Deleted = new List<string> ();
|
public List<string> Deleted = new List<string> ();
|
||||||
public List<string> Edited = new List<string> ();
|
public List<string> Edited = new List<string> ();
|
||||||
public List<string> MovedFrom = new List<string> ();
|
public List<string> MovedFrom = new List<string> ();
|
||||||
public List<string> MovedTo = new List<string> ();
|
public List<string> MovedTo = new List<string> ();
|
||||||
|
|
||||||
|
public List<SparkleNote> Notes = new List<SparkleNote> ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SparkleNote {
|
||||||
|
|
||||||
|
public string UserName;
|
||||||
|
public string UserEmail;
|
||||||
|
|
||||||
|
public DateTime Timestamp;
|
||||||
|
public string Body;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue