Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > a2ac79ac252ef7b89f2f0fc449728720 > files > 164

ikiwiki-3.20190228-1.1.mga6.noarch.rpm

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>commit-internals</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="stylesheet" href="style.css" type="text/css" />

<link rel="stylesheet" href="local.css" type="text/css" />










</head>
<body>

<div class="page">

<div class="pageheader">
<div class="header">
<span>
<span class="parentlinks">

<a href="./index.html">ikiwiki</a>/ 

</span>
<span class="title">
commit-internals

</span>
</span>



</div>









</div>





<div id="pagebody">

<div id="content" role="main">
<p>Saving this irc transcript here, since it's a fairly in-depth discussion of
how ikiwiki handles commits, locking, etc, and avoids some races while
doing so.</p>

<pre><code>&lt;tschwinge&gt; What happens if I edit a page and in the underground a new version is installed into the svn repository?
&lt;tschwinge&gt; The revision when I started editing was saved, right?
&lt;joeyh&gt; what happens, exactly is:
&lt;joeyh&gt; 1. the new version that was committed first get into svn, and ikiwiki updates its WC to have the new version
&lt;joeyh&gt; 2. When you save your edit, ikiwiki detects a conflict.
&lt;joeyh&gt; 3. It uses svn merge to try to resolve it; if it's resolved it adds your changes transparently
&lt;joeyh&gt; 4. If the conflict needs manual resolution, it displays the page with conflict markers in the editor for you to resolve
&lt;tschwinge&gt; Ok.
&lt;joeyh&gt; Note that in step 2, it detects the conflict by using svn info to get the current Revision of the page in the WC, and compares that to a revision that is stored when you start to edit the page
&lt;joeyh&gt; that's why rcs_prepedit exists, to get that revision info
&lt;tschwinge&gt; But isn't there a race condition?
&lt;joeyh&gt; well, there is locking going on too
&lt;joeyh&gt; ikiwiki won't update the WC in step 1. if another instance of itself is getting the Revision info
&lt;tschwinge&gt; Is that lockwiki()?
&lt;joeyh&gt; yeah
&lt;joeyh&gt; note that when it gets the current Revision info of a page during its conflict detection, svn could have changed the page in the repo, and the WC not been updated yet due to the lock, but this isn't a race since the commit will then fail due to a regular svn conflict and the conflict detction will still work.
</code></pre>

</div>







</div>

<div id="footer" class="pagefooter" role="contentinfo">

<div id="pageinfo">






<div id="backlinks">
Links:

<a href="./rcs/details.html">rcs/details</a>


</div>






<div class="pagedate">
Last edited <span class="date">Tue Feb 26 23:01:54 2019</span>
<!-- Created <span class="date">Tue Feb 26 23:01:54 2019</span> -->
</div>

</div>


<!-- from ikiwiki -->
</div>

</div>

</body>
</html>