Allow update when I lock out of date file
Now, when I have to lock out of date file, I only get warning message "One or more your local resources are out of date.. and so on" with "OK" button. It would be better have dialog with something similar "One or more your local resources are out of date. Do you want get latest version?" with button Yes, No.
Fix is planned for the next release
1 comment
-
sarimak
commented
a patch for LockCommand.cs follows:
try
{
e.GetService<IProgressRunner>().RunModal("Locking",
delegate(object sender, ProgressWorkerArgs ee)
{
SvnLockArgs la = new SvnLockArgs();
la.StealLock = stealLocks;
la.Comment = comment;
ee.Client.Lock(files, la);
});
}
catch (Exception ex)
{
if (ex.InnerException is SvnFileSystemOutOfDateException)
{
DialogResult diagResult = MessageBox.Show("There is newer revision in the repository. Do you want to update to latest and lock?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (diagResult == DialogResult.Yes)
{
SvnUpdateResult ur;
ProgressRunnerArgs pa = new ProgressRunnerArgs();
pa.CreateLog = true;SvnRevision updateTo = SvnRevision.Head;
SvnDepth depth = SvnDepth.Empty;
// Update
e.GetService<IProgressRunner>().RunModal(CommandStrings.UpdatingTitle, pa,
delegate(object sender, ProgressWorkerArgs ee)
{
SvnUpdateArgs ua = new SvnUpdateArgs();
ua.Depth = depth;
ua.Revision = updateTo;
e.GetService<IConflictHandler>().RegisterConflictHandler(ua, ee.Synchronizer);
ee.Client.Update(files, ua, out ur);
});// Lock
e.GetService<IProgressRunner>().RunModal("Locking",
delegate(object sender, ProgressWorkerArgs ee)
{
SvnLockArgs la = new SvnLockArgs();
la.StealLock = stealLocks;
la.Comment = comment;
ee.Client.Lock(files, la);
});
}
}
else
throw ex;
}