Author: ratchet Date: 2008-11-27 16:34:19 +0000 (Thu, 27 Nov 2008) New Revision: 23912
Modified: trunk/apps/pyFreenetHg/FreenetHg.py trunk/apps/pyFreenetHg/ReadMe.html Log: sync with 107:ad433fdc01e9 (more docs, removed debug output) Modified: trunk/apps/pyFreenetHg/FreenetHg.py =================================================================== --- trunk/apps/pyFreenetHg/FreenetHg.py 2008-11-27 13:52:07 UTC (rev 23911) +++ trunk/apps/pyFreenetHg/FreenetHg.py 2008-11-27 16:34:19 UTC (rev 23912) @@ -6,7 +6,8 @@ # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COPYING for more details. */ -import os, time +import os +import time import tempfile import random import socket @@ -84,17 +85,17 @@ raise Exception("FCP socket closed by node") remaining -= chunklen buf = "".join(chunks) - print "testi: in:<"+str(len(buf))+" Bytes of data>" +# print "testi: in:<"+str(len(buf))+" Bytes of data>" return buf def readEndMessage(self): #the first line is the message name messagename = self._readline() - print "testi: in:"+messagename +# print "testi: in:"+messagename items = {} while True: line = self._readline(); - print "testi: in:"+line +# print "testi: in:"+line if (len(line.strip()) == 0): continue # an empty line, jump over @@ -109,7 +110,7 @@ return FCPMessage(messagename, items, endmarker) def _sendLine(self, line): - print "testi: out:"+line +# print "testi: out:"+line self.socket.sendall(line+"\n") def _sendMessage(self, messagename, hasdata=False, **kw): @@ -133,7 +134,7 @@ self._sendLine("EndMessage") def _sendData(self, data): - print "testi: out:<"+str(len(data))+" Bytes of data>" +# print "testi: out:<"+str(len(data))+" Bytes of data>" self.socket.sendall(data) class FCPConnection(FCPIOConnection): @@ -540,6 +541,8 @@ pass # store parsed later explizit elif s == 'wlock': pass # called from hook, ignore + elif os.path.isdir(self._rootdir +'/'+s): + pass # unexpected dir, ignore else: self._addItem('', s) Modified: trunk/apps/pyFreenetHg/ReadMe.html =================================================================== --- trunk/apps/pyFreenetHg/ReadMe.html 2008-11-27 13:52:07 UTC (rev 23911) +++ trunk/apps/pyFreenetHg/ReadMe.html 2008-11-27 16:34:19 UTC (rev 23912) @@ -27,6 +27,21 @@ <li><a href="#conf_updatestatic_hook2">updatestatic_hook3</a> (work in progress) </ul> </ul> +<li><a href="#usage">Usage</a> + <ul> + <li><a href="#usage_sharing">Sharing Changes</a> + <ul> + <li><a href="#usage_oneshot">One-shot Repository</a> + <li><a href="#usage_permanent">Creating/updating a more permanent Repository</a> + <li><a href="#usage_bundle">Creating bundles</a> + </ul> + <li><a href="#usage_get">Getting Changes</a> + <li><a href="#usage_unbundle">Unbundling</a> + <li><a href="#usage_clone">Fetching (cloning) a repository</a> + <li><a href="#usage_pull">Pulling changes from a repository</a> + </ul> + + <li><a href="#templates">Templates</a> <ul> <li><a href="#templ_indexpage">Repository Indexpage Template</a> @@ -50,7 +65,6 @@ the basic idea: wrap around (selected) commands and use freenet as transport instead of files hg fcp-bundle -> wraps around hg bundle and put a chk/usk instead a local file hg fcp-unbundle -> wraps around hg unbundle and get it from a chk/usk instead a local file - hg fcp-makestatic -> create a site thats accessible via static-http://127.0.0.1:8888/freenetkey hg fcp-updatestatic -> do a commit hook upload, useful if the insert started from commit hook was failed commit hooks: @@ -65,7 +79,7 @@ python >= 2.4<br> mercurial >= 1.x<br> last not least: a running freenet node ;)<br /> -knowledge about hg native commands <i>makestatic</i> and <i>bund/unbundle</i><br> +knowledge about hg native commands <i>bundle/unbundle</i><br> optional: <a href="/USK at MYLAnId-ZEyXhDGGbYOa1gOtkZZrFNTXjFl1dibLj9E,Xpu27DoAKKc8b0718E-ZteFrGqCYROe7XBBJI57pB4M,AQACAAE/SiteToolPlugin/0/" target="_blank">SiteToolPlugin</a> </p> <a name="download"><h3>Download</h3> @@ -142,6 +156,44 @@ uploadkeyword = triggerword </pre> +<a name="usage"><h3>Usage</h3></a> +<a name="usage_sharing"><h4>Sharing Changes</h4></a> +<a name="usage_oneshot"><h5>One-shot Repository</h5></a> +To insert a repository with a unique key, change to your repository working directory and use this command: +<pre> +hg fcp-updatestatic --uri=CHK@ +</pre> +This circumvents your inserturi settings of the config file and uses a simple CHK key. +<a name="usage_permanent"><h5>Creating/updating a more permanent Repository</h5></a> +To create and update a repository under a USK, just change to your repository working directory and use this command: +<pre> +hg fcp-updatestatic +</pre> +This will use the inserturi from your configfile. The node will take care of USK versioning. +<a name="usage_bundle"><h5>Creating bundles</h5></a> +You can bundle specific changesets and insert them as CHK. Example: +<pre> +hg fcp-bundle --base 5345e333a19b --rev 80f52220ea7c +</pre> +This creates a hg bundle of changes between revision 5345e333a19b and 80f52220ea7c and inserts this as CHK. +For more information on bundle command, see the mercurial documentation. +<a name="usage_sharing"><h4>Getting Changes</h4></a> +<a name="usage_unbundle"><h5>Unbundling</h5></a> +To merge a bundled changeset into your repository, change to the working directory and use: +<pre> +hg fcp-unbundle CHK at .... +</pre> +<a name="usage_clone"><h5>Fetching (cloning) a repository</h5></a> +To clone another repository, just use the normal hg command <i>clone</i> and use static-http as transport: +<pre> +hg clone static-http://127.0.0.1:8888/USK at ..../<version> +</pre> +<a name="usage_pull"><h5>Pulling changes from a repository</h5></a> +The same applies for pulling changes into an existing repository: +<pre> +hg pull static-http://127.0.0.1:8888/USK at ..../<version> +</pre> + <a name="templates"><h3>Templates</h3></a> <a name="templ_indexpage"><h4>Repository Indexpage Template</h4></a> The standard hg repository is not a regular freesite, so you get usually a "Not in Archive" error if you access the repository
