From 3aab99fae5f7681154a35a3e75d8e225424e2d8b Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Sat, 7 Feb 2009 14:19:28 -0500 Subject: --post-commit won't delete pages and --refresh seems no deadlock --- doc/todo/mercurial.mdwn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc/todo/mercurial.mdwn') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index f0dbf9806..c0af10719 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -29,6 +29,25 @@ This should update the working directory and run ikiwiki every time a change is > It can deadlock if the post-commit hook runs with --refresh in the > former case. --[[Joey]] +The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki --setup setupfile --post-commit will not delete them in $DEST. + +I add the following to .hg/hgrc: + + [hooks] + changegroup = hg update >&2 && ikiwiki --setup path.to.setup.file --refresh + post-commit = ikiwiki --setup path.to.setup.file --refresh + +I tried the follwing commands in $SRC: + + touch deadlocktest.mdwn + hg add + hg ci + +No deadlock happens. (Also I push to the $SRC from another machine, again, no deadlock.) + +Of course these tests are too simple. The problem is I have no idea when the deadlock will happen. If someone is kind enough to point out, I will run more test. + + *** I have a few notes on mercurial usage after trying it out for a while: -- cgit v1.2.3 From 2cc6a07f5492912f35d103bcc57753f21ee09ecf Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Sat, 7 Feb 2009 14:22:01 -0500 Subject: (tiny) markdown syntax --- doc/todo/mercurial.mdwn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/todo/mercurial.mdwn') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index c0af10719..26888131e 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -33,15 +33,15 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki I add the following to .hg/hgrc: - [hooks] - changegroup = hg update >&2 && ikiwiki --setup path.to.setup.file --refresh - post-commit = ikiwiki --setup path.to.setup.file --refresh + [hooks] + changegroup = hg update >&2 && ikiwiki --setup path.to.setup.file --refresh + post-commit = ikiwiki --setup path.to.setup.file --refresh I tried the follwing commands in $SRC: - touch deadlocktest.mdwn - hg add - hg ci + touch deadlocktest.mdwn + hg add + hg ci No deadlock happens. (Also I push to the $SRC from another machine, again, no deadlock.) -- cgit v1.2.3 From dc0409b4a717da9926e618341cbd96ab1c4cb763 Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Sat, 7 Feb 2009 14:49:06 -0500 Subject: I guess changegroup is better than incoming --- doc/todo/mercurial.mdwn | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'doc/todo/mercurial.mdwn') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 26888131e..9635b6880 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -31,7 +31,7 @@ This should update the working directory and run ikiwiki every time a change is The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki --setup setupfile --post-commit will not delete them in $DEST. -I add the following to .hg/hgrc: +I add the following to .hg/hgrc:(I use changegroup since I don't think we need refresh per changeset, please point out if I am wrong.) [hooks] changegroup = hg update >&2 && ikiwiki --setup path.to.setup.file --refresh @@ -43,7 +43,9 @@ I tried the follwing commands in $SRC: hg add hg ci -No deadlock happens. (Also I push to the $SRC from another machine, again, no deadlock.) +No deadlock happens. (Also I push to the $SRC from another machine, again, no deadlock. If there is conflicts between $SRC and my own repo, hg pull will abort. You have to pull, merge and push again.) + + Of course these tests are too simple. The problem is I have no idea when the deadlock will happen. If someone is kind enough to point out, I will run more test. -- cgit v1.2.3 From 6605764c523787141272fe83c3d46a65aea7649d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 9 Feb 2009 14:58:10 -0500 Subject: Fix unusual --setup --post-commit command line option combo. --- debian/changelog | 1 + doc/todo/mercurial.mdwn | 25 +++++++++++++++++++++++++ ikiwiki.in | 6 ++++-- 3 files changed, 30 insertions(+), 2 deletions(-) (limited to 'doc/todo/mercurial.mdwn') diff --git a/debian/changelog b/debian/changelog index c9878c719..d2b701db7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ ikiwiki (3.04) UNRELEASED; urgency=low * Work around XML::Atom strangeness that results in double-encoded posts. (smcv) * Updated German translation (Kai Wasserbäch). Closes: #514251 + * Fix unusual --setup --post-commit command line option combo. -- Joey Hess Sat, 31 Jan 2009 19:04:45 -0500 diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 9635b6880..e45629102 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -31,6 +31,13 @@ This should update the working directory and run ikiwiki every time a change is The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki --setup setupfile --post-commit will not delete them in $DEST. +> You should really be using a setup file that has `mercurial_wrapper` +> set, and running the wrapper generated by that from your hook. +> That will work. I think that the `--setup --post-commit` on the command +> line is currently broken and does the same expensive rebuild process as --setup +> alone (which doesn't delete files from $DEST either). Will fix that. +> --[[Joey]] + I add the following to .hg/hgrc:(I use changegroup since I don't think we need refresh per changeset, please point out if I am wrong.) [hooks] @@ -49,6 +56,24 @@ No deadlock happens. (Also I push to the $SRC from another machine, again, no d Of course these tests are too simple. The problem is I have no idea when the deadlock will happen. If someone is kind enough to point out, I will run more test. +> For the deadlock to occur, a edit has to be made via the web. +> +> Ikiwiki, +> running as a CGI, takes a lock on the wiki, and commits the edit, +> continuing to run in the background, with the lock still held. +> When the edit is committed, the hg hook runs, running `ikwiki --refresh`. +> Nearly the first thing that process does it try to lock the wiki.. +> which is already locked. This lock is taken in a blocking manner, +> thus the deadlock -- the cgi is waiting for the commit to finish before +> dropping the lock, and the commit is blocked waiting for the lock to be +> released. +> +> --post-commit avoids this problem by checking if the cgi is running +> and avoiding doing anything in that case. (While still handing the +> refresh if the commit was not made by the CGI.) +> So in that case, the commit finishes w/o ikiwiki doing anything, +> and the ikiwiki CGI handles the wiki refresh. +> --[[Joey]] *** diff --git a/ikiwiki.in b/ikiwiki.in index 32a24af84..c79a2bfef 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -135,7 +135,8 @@ sub main () { if (@{$config{wrappers}} && ! $config{render} && ! $config{dumpsetup} && - (! $config{refresh} || $config{genwrappers})) { + ((! $config{refresh} && ! $config{post_commit}) + || $config{genwrappers})) { debug(gettext("generating wrappers..")); require IkiWiki::Wrapper; my %origconfig=(%config); @@ -157,7 +158,8 @@ sub main () { } # setup implies a wiki rebuild by default - if (! $config{refresh} && ! $config{render}) { + if (! $config{refresh} && ! $config{render} && + ! $config{post_commit}) { $config{rebuild}=1; } } -- cgit v1.2.3 From ff5d52b0d2dc025cedadb3b9d06f46e8954d7a38 Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Tue, 10 Feb 2009 04:38:14 -0500 Subject: del wrong hook & ikiwiki --post-commit --a-lot-of-switches --- doc/todo/mercurial.mdwn | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'doc/todo/mercurial.mdwn') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index e45629102..2f844db03 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -29,7 +29,7 @@ This should update the working directory and run ikiwiki every time a change is > It can deadlock if the post-commit hook runs with --refresh in the > former case. --[[Joey]] -The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki --setup setupfile --post-commit will not delete them in $DEST. +The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki --setup setupfile --post-commit will not delete them in $DEST. --[[weakish]] > You should really be using a setup file that has `mercurial_wrapper` > set, and running the wrapper generated by that from your hook. @@ -38,23 +38,23 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki > alone (which doesn't delete files from $DEST either). Will fix that. > --[[Joey]] +>> Mercurial doesn't support put hooks in .hg/hooks/* (like git). In Mercurial, the only way to run +>> your own hooks is specifying them in the hgrc file. (Or write a new extension.) +>> I guess use a very long command will work. +>> (e.g. ikiwiki --post-commit --a-lot-of-switches --set var=value $SRC $DEST) +>> (Fortunately ikiwiki supports --set var=value so without --setup works.) +>> +>> Alternative is always editing via cgi or pushing. Never work on the $SRC/repo directly. +>> --[[weakish]] + I add the following to .hg/hgrc:(I use changegroup since I don't think we need refresh per changeset, please point out if I am wrong.) [hooks] changegroup = hg update >&2 && ikiwiki --setup path.to.setup.file --refresh - post-commit = ikiwiki --setup path.to.setup.file --refresh - -I tried the follwing commands in $SRC: - - touch deadlocktest.mdwn - hg add - hg ci -No deadlock happens. (Also I push to the $SRC from another machine, again, no deadlock. If there is conflicts between $SRC and my own repo, hg pull will abort. You have to pull, merge and push again.) +

post-commit = ikiwiki --setup path.to.setup.file --refreshThis will cause deadlock! See bleow!

- - -Of course these tests are too simple. The problem is I have no idea when the deadlock will happen. If someone is kind enough to point out, I will run more test. +I have no idea when the deadlock will happen. --[[weakish]] > For the deadlock to occur, a edit has to be made via the web. > @@ -75,6 +75,7 @@ Of course these tests are too simple. The problem is I have no idea when the de > and the ikiwiki CGI handles the wiki refresh. > --[[Joey]] + *** I have a few notes on mercurial usage after trying it out for a while: -- cgit v1.2.3 From 12a72e758382c8efb9cdd6c66e06d9de094a4b29 Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Tue, 10 Feb 2009 04:42:03 -0500 Subject: update for rename of todo/weakish.mdwn to users/weakish.mdwn --- doc/todo/mercurial.mdwn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/todo/mercurial.mdwn') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 2f844db03..89f5337ab 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -29,7 +29,7 @@ This should update the working directory and run ikiwiki every time a change is > It can deadlock if the post-commit hook runs with --refresh in the > former case. --[[Joey]] -The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki --setup setupfile --post-commit will not delete them in $DEST. --[[weakish]] +The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki --setup setupfile --post-commit will not delete them in $DEST. --[[users/weakish]] > You should really be using a setup file that has `mercurial_wrapper` > set, and running the wrapper generated by that from your hook. @@ -45,7 +45,7 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki >> (Fortunately ikiwiki supports --set var=value so without --setup works.) >> >> Alternative is always editing via cgi or pushing. Never work on the $SRC/repo directly. ->> --[[weakish]] +>> --[[users/weakish]] I add the following to .hg/hgrc:(I use changegroup since I don't think we need refresh per changeset, please point out if I am wrong.) @@ -54,7 +54,7 @@ I add the following to .hg/hgrc:(I use changegroup since I don't think we need r

post-commit = ikiwiki --setup path.to.setup.file --refreshThis will cause deadlock! See bleow!

-I have no idea when the deadlock will happen. --[[weakish]] +I have no idea when the deadlock will happen. --[[users/weakish]] > For the deadlock to occur, a edit has to be made via the web. > -- cgit v1.2.3 From c0405e0f20e49c382b656bf9c83c4dd1aa0fc187 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Feb 2009 13:18:54 -0500 Subject: response --- doc/todo/mercurial.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/todo/mercurial.mdwn') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 89f5337ab..414aaa807 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -36,6 +36,7 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki > That will work. I think that the `--setup --post-commit` on the command > line is currently broken and does the same expensive rebuild process as --setup > alone (which doesn't delete files from $DEST either). Will fix that. +> (fixed) > --[[Joey]] >> Mercurial doesn't support put hooks in .hg/hooks/* (like git). In Mercurial, the only way to run @@ -47,6 +48,10 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki >> Alternative is always editing via cgi or pushing. Never work on the $SRC/repo directly. >> --[[users/weakish]] +>>> I don't see anything preventing you from using a setup file with +>>> `mercurual_wrapper => ".hg/ikiwiki-hook",` and then modifying the hgrc +>>> to run that wrapper. --[[Joey]] + I add the following to .hg/hgrc:(I use changegroup since I don't think we need refresh per changeset, please point out if I am wrong.) [hooks] -- cgit v1.2.3 From 257cbbcb7e151053641bde409253a1ea792e9569 Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Fri, 13 Feb 2009 05:05:09 -0500 Subject: The wrapper works nicely! --- doc/todo/mercurial.mdwn | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'doc/todo/mercurial.mdwn') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 414aaa807..2f148498e 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -49,15 +49,19 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki >> --[[users/weakish]] >>> I don't see anything preventing you from using a setup file with ->>> `mercurual_wrapper => ".hg/ikiwiki-hook",` and then modifying the hgrc +>>> `mercurial_wrapper => ".hg/ikiwiki-hook",` and then modifying the hgrc >>> to run that wrapper. --[[Joey]] +>> Thanks for pointing out this. I have some stupid misunderstanding on the +>> usage of mercurial_wrapper before. The wrapper works nicely! --[[weakish]] + I add the following to .hg/hgrc:(I use changegroup since I don't think we need refresh per changeset, please point out if I am wrong.) [hooks] changegroup = hg update >&2 && ikiwiki --setup path.to.setup.file --refresh + post-commit = path.to.the.mercurial.wrapper -

post-commit = ikiwiki --setup path.to.setup.file --refreshThis will cause deadlock! See bleow!

+----- I have no idea when the deadlock will happen. --[[users/weakish]] -- cgit v1.2.3 From c2df40c01ba78e0c0631df0a5042980eb1688488 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 26 Feb 2009 14:16:13 -0500 Subject: mercurial and tla are missing implementations of several things --- doc/todo/mercurial.mdwn | 4 ++++ doc/todo/tla.mdwn | 3 +++ 2 files changed, 7 insertions(+) (limited to 'doc/todo/mercurial.mdwn') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 2f148498e..e71c8106a 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -14,6 +14,10 @@ It seems that with the current mercurial commit code, it will always blindly overwrite the current file with the web edited version, losing any other changes. +* `rcs_commit_staged`, `rcs_rename`, `rcs_remove`, and `rcs_diff` are not + implemented for mercurial, and so attachments, remove and rename plugins + and recentchangesdiff cannot be used with it. (These should be fairly + easy to add..) Posthook: in `$srcdir/.hg/hgrc`, I have the following diff --git a/doc/todo/tla.mdwn b/doc/todo/tla.mdwn index 6ef8453f1..b6b082cfe 100644 --- a/doc/todo/tla.mdwn +++ b/doc/todo/tla.mdwn @@ -1,4 +1,7 @@ * Need to get post commit hook code working. * Need some example urls for web based diffs. +* `rcs_commit_staged`, `rcs_rename`, `rcs_remove`, are not + implemented for tla, and so attachments, remove and rename plugins + cannot be used with it. (These should be fairly easy to add..) [[!tag rcs/tla]] -- cgit v1.2.3