2008-05-26T00:01:25 <dreimark> File "xmlrpclib.py", line 639, in dump_nil
2008-05-26T00:01:31 <dreimark> raise TypeError, "cannot marshal None unless allow_none is enabled"
2008-05-26T00:01:57 <xorAxAx> hmm, yeah, so why isnt it allowed :)
2008-05-26T00:03:06 <xorAxAx> dreimark: is that a server-side or client-side exception?
2008-05-26T00:03:15 <xorAxAx> because the client allows none
2008-05-26T00:03:50 <dreimark> that was on the server (remoteWiki)
2008-05-26T00:04:10 <xorAxAx> weird
2008-05-26T00:05:26 <xorAxAx> ok
2008-05-26T00:05:43 <xorAxAx> MoinMoin.xmlrpc:162 needs allow_none=True
2008-05-26T00:09:18 <xorAxAx> dreimark: can you do the change? then it should work
2008-05-26T00:10:47 <dreimark> will try
2008-05-26T00:22:31 <dreimark> xorAxAx: if I change 167 to response = xmlrpclib.dumps(response, methodresponse=1, allow_none=1)
2008-05-26T00:23:00 <dreimark> line 162 does not give a change
2008-05-26T00:23:10 <xorAxAx> ah, then you have a different version than me :)
2008-05-26T00:23:29 <xorAxAx> i have 8fbdd3667488 tip
2008-05-26T00:23:41 <dreimark> then I do get NoneType object has no attribute replace in package.py
2008-05-26T00:23:49 <xorAxAx> very nice
2008-05-26T00:23:49 <dreimark> line 65
2008-05-26T00:24:30 <xorAxAx> package.py?
2008-05-26T00:24:38 <dreimark> in packline
2008-05-26T00:25:51 <xorAxAx> thats weird
2008-05-26T00:26:13 <xorAxAx> and probably a bug because of lacking tests
2008-05-26T00:29:36 <dreimark> second item is None e.g. ['9dfetwer...', None]
2008-05-26T00:30:14 <xorAxAx> ah
2008-05-26T00:30:18 <xorAxAx> then its clear
2008-05-26T00:30:45 <xorAxAx> its an API mismatch
2008-05-26T00:31:33 <xorAxAx> gn
2008-05-26T00:31:47 <dreimark> gn Alexander
2008-05-26T00:35:54 <dreimark> btw. same version here
2008-05-26T01:01:13 <byeongweon> xorAxAx: good morning(in Korea), and good night(in Germany).
2008-05-26T01:01:49 <dreimark> hi byeongweon
2008-05-26T01:02:01 <byeongweon> hi dreimark
2008-05-26T01:02:10 <dreimark> Alexander is probably sleeping already
2008-05-26T01:02:23 <byeongweon> It seems like. :-)
2008-05-26T01:02:46 <byeongweon> I was check Germany's time just.
2008-05-26T01:03:07 <dreimark> Thomas has created a repo for you 1.8-guieditor-mbyeongweon
2008-05-26T01:04:20 <byeongweon> oh, really? I will check that.
2008-05-26T01:22:06 <dreimark> good night
2008-05-26T07:08:17 <ThomasWaldmann> moin
2008-05-26T09:22:34 <dreimark> moin
2008-05-26T10:00:28 <dreimark> AttachFile has a problem in 1.6
2008-05-26T10:02:39 <dreimark> 7 too
2008-05-26T10:02:41 <dreimark> 1.7 too
2008-05-26T10:11:18 * ThomasWaldmann begins to write some ldap test framework
2008-05-26T10:11:29 <ThomasWaldmann> dreimark: only one? :P
2008-05-26T10:13:46 <dreimark> hehe, but that one is a bit dump http://moinmo.in/MoinMoinBugs/AttachmentUnzipCanCauseUnicodeDecodeError
2008-05-26T10:14:43 <dreimark> you can remove the wrong file only with access to the filesystem
2008-05-26T10:15:12 <dreimark> s/dump/dumb/
2008-05-26T10:18:08 <dennda> moin
2008-05-26T10:19:35 <dennda> Ok I just encountered a strange bug
2008-05-26T10:19:48 <dennda> I cannot log in to moinmo.in with my laptop, but with my desktop it works flawlessly
2008-05-26T10:20:00 <dennda> (And yes, I tried that far more than once. I even reset my password)
2008-05-26T10:24:16 <dennda> ThomasWaldmann: Are there any logs that you can consult to find further information on the problem? I am sure I entered the password correctly
2008-05-26T10:28:09 <dennda> By the way, am I supposed to put my copyright notice for 2008 into all of the files?
2008-05-26T10:36:22 <dreimark> dennda: check your cookies remove all moin cookies
2008-05-26T10:37:21 <dennda> dreimark: Works now, thanks. What was wrong?
2008-05-26T10:38:14 <dreimark> dennda: do you have removed your cookies?
2008-05-26T10:38:27 <dennda> dreimark: yes
2008-05-26T10:38:31 <dennda> after that it worked
2008-05-26T10:39:18 <dreimark> I think there is a mismatch between the session cookie and the session cache.
2008-05-26T10:39:59 <dreimark> on some unknown circumstances the login process seems not to be able to remove the wrong cookie itselfs
2008-05-26T10:40:41 <dreimark> I've repaired by a colleague on Wednesday too
2008-05-26T10:41:08 <dreimark> this
2008-05-26T10:41:32 <dreimark> (keyboard eats currently words, sometimes only letters ;) )
2008-05-26T10:42:07 <dennda> hehe
2008-05-26T10:42:08 <dennda> ok
2008-05-26T10:42:28 <dennda> What about the copyright notices? Are we SoC students supposed to put it in the files for 2008?
2008-05-26T10:43:18 <dreimark> yes, on files you do significant changes
2008-05-26T11:17:30 <PawelPacana> hello
2008-05-26T11:18:37 <johill> hi
2008-05-26T11:20:19 <dennda> hi
2008-05-26T11:21:04 <dreimark> hi PawelPacana
2008-05-26T11:21:29 <dreimark> do you have already send your ssh key to ThomasWaldmann ?
2008-05-26T11:23:29 <PawelPacana> as the moment of writng, yes
2008-05-26T11:24:23 <dennda> johill: in storage.txt you make the following requirement "Items must be looked up by name" -- Shouldn't that be "by id"?
2008-05-26T11:24:53 <johill> dennda: no, the original lokup from the API goes by name
2008-05-26T11:25:15 <johill> dennda: only internally you can do something like by ID when you need more info about an item (starting from an Item class, and not from nohting)
2008-05-26T11:25:16 <dennda> It's with IDs only internally?
2008-05-26T11:25:19 <johill> s/class/object/
2008-05-26T11:25:28 <dennda> ok
2008-05-26T11:25:44 <johill> keep in mind that the default fs backend can't support IDs
2008-05-26T11:26:04 <johill> (though it is actually possible by keeping the name->id mapping in a separate file and making the item dirs by ID)
2008-05-26T11:26:21 <dennda> Could you give an example ID?
2008-05-26T11:26:29 <johill> 17
2008-05-26T11:26:38 <dennda> so just plain ints
2008-05-26T11:26:38 <johill> 42?
2008-05-26T11:26:42 <johill> whatever
2008-05-26T11:26:58 <johill> it's an internal attribute, the sql will probably just use the auto-increment int ID
2008-05-26T11:27:01 <dennda> let's choose something funny
2008-05-26T11:27:03 <dennda> prime numbers
2008-05-26T11:27:44 <johill> my hypothetical filesystem backend that uses IDs will maybe use simple strings '42'
2008-05-26T11:28:08 <dennda> anyway, I'll start with the new api definition now
2008-05-26T11:28:30 <johill> (actually, such a filesystem backend could be a good thing to have, we're starting toreach the fs limits with Korean pagenames etc.
2008-05-26T11:38:54 <johill> PawelPacana: are you aware of dennda doing storage refactoring?
2008-05-26T11:41:52 <PawelPacana> sure
2008-05-26T11:42:08 <PawelPacana> i`ll have to keep track od denda`s changes
2008-05-26T11:42:14 <johill> ok, good, just wanted to make sure :)
2008-05-26T11:42:27 <johill> oh btw
2008-05-26T11:42:56 <johill> if it's easier for you, I think it might be possible to support string revision IDs, instead of increasing numbers
2008-05-26T11:43:16 * PawelPacana is reading moin-dev logs from last 10 days...
2008-05-26T11:44:00 <PawelPacana> johill: ok, we`ll discuss this later
2008-05-26T12:43:14 <zenhase> moin
2008-05-26T12:43:30 <zenhase> sorry for the late start in the day ... the server upgrade went ... erm .. not smoothly :o
2008-05-26T12:46:33 <dennda> johill: I hope my connection is not too weak
2008-05-26T12:46:42 * dennda is in university atm and sometimes it breaks
2008-05-26T12:46:58 <dennda> I am currently working on defining the new API
2008-05-26T12:47:02 <johill> why? I can't monitor you round the clock anyway ;)
2008-05-26T12:48:00 <dennda> damn, it happened again. Well I wanted to discuss it with you
2008-05-26T12:48:21 <johill> oh ok, sure
2008-05-26T12:48:53 <johill> but if your connection is too flakey now we can postpone till later too unless you think you need my feedback now
2008-05-26T12:49:41 <dennda> but the connection is too slow by far... later
2008-05-26T12:50:39 <johill> I'll go do some shopping and other things then, be back later
2008-05-26T12:50:59 <zenhase> moin dennda, moin johill :)
2008-05-26T12:53:07 <dreimark> moin zenhase
2008-05-26T12:53:49 <dreimark> hi johill
2008-05-26T12:54:03 <dreimark> do you have an idea why http://moinmo.in/MoinMoinBugs/1.7NoSessionCookieCreatedOnKonqueror
2008-05-26T12:54:09 <dreimark> this can happen
2008-05-26T12:54:38 <johill> not a clue
2008-05-26T12:55:04 <dreimark> it works in 1.6.x I do have some users using that browser
2008-05-26T12:55:29 <johill> weird
2008-05-26T13:06:35 <zenhase> dennda: you have no repository at hg.moinmo.in?
2008-05-26T13:12:47 <PawelPacana> hi zenhase
2008-05-26T13:13:34 <dreimark> gizmo__: I will go tom. to zuerich, switzerland.
2008-05-26T13:13:47 <dreimark> will be back at Friday evening
2008-05-26T13:14:14 <PawelPacana> dennda: will you work on 1.7-storage-hwendel branch or plain 1.8? Or they are already merged?
2008-05-26T13:14:22 <dreimark> xorAxAx: can you fix this api problem with wikisync?
2008-05-26T13:20:05 <xorAxAx> dreimark: can you tell me in which line in wikisync the packline call is done?
2008-05-26T14:16:40 <dreimark> xorAxAx: 197 self.is_anonymous = remote_interwikiname is None
2008-05-26T14:16:54 <dreimark> may result in None is None which is True, can't debug this currently
2008-05-26T14:17:13 <xorAxAx> dreimark: thats the point of the line :)
2008-05-26T14:17:14 <dreimark> have to prepare me for this conference
2008-05-26T14:17:29 <xorAxAx> while looking at the code, it looks correct. did you checkin the allow_none change?
2008-05-26T14:19:17 <dreimark> I did not continue because of your "Ah then it's clear" ;)
2008-05-26T14:20:58 <dreimark> bbl
2008-05-26T14:27:04 <xorAxAx> well, i thought it was clear but its not :)
2008-05-26T15:17:27 <PawelPacana> has anyone tried rendering docbook from page on moin1.7 and PyXML 0.8.4?
2008-05-26T15:17:45 <PawelPacana> i got some import errors
2008-05-26T15:21:35 <PawelPacana> in ext.reader from xml.dom
2008-05-26T15:23:35 <dennda> PawelPacana, zenhase: I got no repo yet. I think ThomasWaldmann will merge with the current storage branch and then provide a repo for me
2008-05-26T15:23:46 <zenhase> ah ok
2008-05-26T15:23:51 <zenhase> well makes sense
2008-05-26T15:23:58 <dennda> PawelPacana: Anyway, you may want to check my personal page on the wiki
2008-05-26T15:25:55 <PawelPacana> dennda: subscribed
2008-05-26T15:26:02 <dennda> johill: please ping me when you return
2008-05-26T15:26:03 <dennda> PawelPacana: ok
2008-05-26T15:26:45 <PawelPacana> at the end of the day i`ll give you link to my progress/discussion page
2008-05-26T15:26:49 <johill> dennda: sort of here, just looking in for a minute, what's up?
2008-05-26T15:27:02 <dennda> johill: Wanna talk about the API design
2008-05-26T15:27:12 <dennda> johill: But do whatever you need to do first
2008-05-26T15:27:37 <johill> ok, probably back in 1.5-2 hours, maybe quicker if I manage
2008-05-26T15:28:15 <dennda> ok, just ping me.
2008-05-26T15:28:42 <PawelPacana> denda: as for the repo, i would rather like to have my own. however we should sync frequently
2008-05-26T15:28:56 <dennda> PawelPacana: Ok, great. I suggested the same
2008-05-26T15:29:45 * PawelPacana digged that in moin-logs too
2008-05-26T15:54:34 <PawelPacana> how many of you are going to EuroPython this year? seems there is early-bird rate till end of may
2008-05-26T16:05:46 <dreimark> johill: konqueror does not like ; in cookie.output() I can get a cookie into konqueror if I replace that sign by something else.
2008-05-26T16:07:36 <dreimark> in 1.6 the cookie works with the ;
2008-05-26T16:08:01 <dreimark> in konqueror too but the cookie.output() is a bit different
2008-05-26T16:17:54 <johill> dennda: was a lot quicker than expected, back now
2008-05-26T16:18:08 <johill> dreimark: what sign?
2008-05-26T16:19:18 <dennda> johill: I just had some thoughts coming to my mind when writing down the API definitions that I'd like to discuss / get further insights on
2008-05-26T16:19:40 <johill> sounds good
2008-05-26T16:19:46 <dennda> ok so
2008-05-26T16:20:09 <johill> PawelPacana: this might impact you as well :)
2008-05-26T16:20:24 <dennda> (Maybe we already discussed that on the phone, but my brain is a sieve and I don't have a recording of that call :))
2008-05-26T16:20:37 <dennda> we have has_item() and get_item()
2008-05-26T16:20:47 <dennda> One of which may just use the other
2008-05-26T16:21:01 <johill> yeah I suppose we can just leave one out, I think we said that
2008-05-26T16:21:20 <johill> well, has_item could be left out
2008-05-26T16:21:41 <dennda> I suggest doing something like: def has_item(); try: get_item(); return True; except ItemNotFoundError: return False
2008-05-26T16:21:44 <dennda> pseudo
2008-05-26T16:22:06 <dennda> johill: I'm not talking about try_get_item and get_item but about has_item and get_item :)
2008-05-26T16:22:19 <dennda> I do think it's handy to have has_item
2008-05-26T16:22:20 <johill> yeah we talked about that, heh :)
2008-05-26T16:22:25 <johill> well is it really?
2008-05-26T16:22:28 <johill> where would it be used?
2008-05-26T16:22:34 <johill> I'm starting to think it doesn't make sense
2008-05-26T16:23:09 <dennda> Well it's much shorter to write if has_item if you just need to know if it's there or not
2008-05-26T16:23:17 <johill> but when do you need to know?
2008-05-26T16:23:26 <johill> I'm thinking that 99% of all code should just try to get the item
2008-05-26T16:23:32 <dennda> ok
2008-05-26T16:23:37 <dennda> When in doubt, leave it out
2008-05-26T16:23:38 <johill> and if that raises an exception, propagate that very high
2008-05-26T16:23:41 <dennda> We can still add it later on
2008-05-26T16:23:47 <johill> yeah, true
2008-05-26T16:23:51 <johill> I watched the talk btw
2008-05-26T16:23:54 <dennda> and?
2008-05-26T16:23:59 <johill> the video had a number of errors that made my n810 choke
2008-05-26T16:24:10 <dennda> oh
2008-05-26T16:24:11 <johill> so I had to skip around a lot
2008-05-26T16:24:14 <dennda> worked fine here
2008-05-26T16:24:24 <johill> hence I may have missed a few things but probably not much
2008-05-26T16:24:34 <johill> the bcopy vs. strncpy example was bogus tho
2008-05-26T16:25:04 <johill> those are two groups of APIs coming from totally different origins :)
2008-05-26T16:25:30 <johill> but yeah, good stuff, bit java centric
2008-05-26T16:25:41 <ThomasWaldmann> PawelPacana: test your ssh repo access
2008-05-26T16:26:01 <dennda> johill: I got a few more questions:
2008-05-26T16:26:19 <johill> sure, sorry for interrupting
2008-05-26T16:26:46 <dennda> johill: What shall I use as method definition for some of the methods? just like def create_item(self, name)?
2008-05-26T16:26:49 <dennda> johill: no worries
2008-05-26T16:27:28 <TheSheep> has_item would be handly for link formatting, for example...
2008-05-26T16:27:40 <TheSheep> but that's one place only
2008-05-26T16:27:44 * dennda is a bit hurt by java where you need to explicitly tell what arguments a method has
2008-05-26T16:27:48 <TheSheep> at least one per formatter
2008-05-26T16:27:49 <johill> dennda: I don't see much choice
2008-05-26T16:28:04 <johill> TheSheep: good point, maybe that even occurs often enough to make us want to not catch the exception
2008-05-26T16:29:42 <dennda> johill: so just create_item(self, name), get_item(self, name), ...? (by the way I use a more consistent naming of methods
2008-05-26T16:30:16 <dennda> any wishes? I think get, search, rename, etc. are a bit to general. I use search_item, get_item, rename_item now.
2008-05-26T16:30:19 <dennda> :)
2008-05-26T16:30:28 <dreimark> johill: output.replace(';', '!') gives a cookie in konqueror which expires at end of the session
2008-05-26T16:31:48 <johill> dreimark: wtf?
2008-05-26T16:32:13 <PawelPacana> ThomasWaldmann: working
2008-05-26T16:32:15 <johill> dennda: sounds good
2008-05-26T16:32:20 <dennda> ok
2008-05-26T16:33:15 <dennda> johill: I was wondering... Isn't iteritems a bit heavy if you got a million Items? (Even if it's a iterator)
2008-05-26T16:34:47 <dennda> frankly, I don't know
2008-05-26T16:36:20 <johill> not sure, I don't think so
2008-05-26T16:36:31 <johill> you throw them away right away usually, don't you think?
2008-05-26T16:37:55 <ThomasWaldmann> ok
2008-05-26T16:38:17 <TheSheep> dennda: isn't an 'item' object a lightweight one, just like Page is now?
2008-05-26T16:38:34 <dreimark> johill: why was the cookie hash removed?
2008-05-26T16:38:47 <dennda> TheSheep: I'll come to that later :)
2008-05-26T16:39:28 <johill> dreimark: in 1.7? because it's useless now with sessions
2008-05-26T16:39:41 <johill> TheSheep: yeah I think it should be
2008-05-26T16:40:38 <dennda> johill: ok. Next thing which is out of interest: In storage.txt line 79 ff. you say that the latter expression avoids race conditions. Why is that? Because name and item are retreived at the very same moment?
2008-05-26T16:41:20 * johill looks
2008-05-26T16:41:25 <TheSheep> one think I was wondering about (I think I saw it in bzr API) is had_item
2008-05-26T16:41:43 <johill> yeah
2008-05-26T16:41:50 <TheSheep> for when there are old revisions of an item, but the item can be possibly deleted
2008-05-26T16:42:13 <johill> if you do iteritems() then you don't have a race between getting the name off the list and looking up the item for it
2008-05-26T16:42:22 <johill> assuming it's implemented properly in the backend
2008-05-26T16:42:58 <dennda> ok
2008-05-26T16:45:16 <TheSheep> you still get race conditions if you try to get the item's content or metadata though
2008-05-26T16:45:28 <johill> TheSheep: yes, but only with the filesystem backend
2008-05-26T16:45:41 <johill> TheSheep: an sql backend or a different backend could put an ID into the Item instance and use that later
2008-05-26T16:46:29 <TheSheep> johill: hmm.. filesystem backend could too
2008-05-26T16:47:10 <TheSheep> johill: are metadata revisions immutable just like file revisions?
2008-05-26T16:47:39 <TheSheep> s/file/item content/
2008-05-26T16:48:16 <johill> TheSheep: revision metadata is, yes, but the current filesystem backend cannot protect against renaming
2008-05-26T16:49:45 <TheSheep> hmm...
2008-05-26T16:51:36 <johill> that's just a limitation of the current stuff, we'll have to live with it
2008-05-26T16:51:48 <TheSheep> I guess leaving the page histry under the old name and having some 'see old name' revisions could be a good idea, but that's pretty complicated
2008-05-26T16:51:49 <johill> the API lanius designed, however, could never fix it
2008-05-26T16:52:18 <johill> TheSheep: you could have a filesystem backend that just stored items in numeric dirs and kept a mapping file or even used symlinks
2008-05-26T16:52:32 <TheSheep> johill: tha's obscure
2008-05-26T16:52:42 <TheSheep> johill: like some database or something XD
2008-05-26T16:52:59 <johill> still better than requiring sql I think
2008-05-26T16:53:01 <TheSheep> johill: I had enough trouble with the user storage in moin already
2008-05-26T16:55:23 <johill> heh yeah
2008-05-26T16:58:29 <johill> wow the code_area api is awful
2008-05-26T16:58:53 <johill> **kw, crappy defaults in html, not implemented in others...
2008-05-26T17:04:56 <dennda> irssi bitching around...
2008-05-26T17:13:24 <johill> heh
2008-05-26T17:13:29 <johill> I had it crash a few months ago
2008-05-26T17:16:26 <dennda> it didn't "crash"
2008-05-26T17:22:41 <johill> I don't quite remember, maybe it was just somehow stuck
2008-05-26T17:29:32 <dennda> johill: Your spec demands for Item: - 'name' property (read-only)
2008-05-26T17:29:51 <dennda> I didn't quite know that you can make an attribute read-only
2008-05-26T17:31:07 <johill> name = property(get_name)
2008-05-26T17:31:10 <johill> should work, no?
2008-05-26T17:31:37 <johill> in new-style objects. old-style objects the whole property will be replacable
2008-05-26T17:31:44 * dennda takes a look at pythons properties
2008-05-26T17:32:21 <johill> s/old-/in old-/
2008-05-26T17:33:02 <johill> so make sure everything descends from 'object'
2008-05-26T17:33:16 <dennda> yep
2008-05-26T17:33:37 <johill> maybe we should not provide that property anyway
2008-05-26T17:33:44 <dreimark> johill: found it
2008-05-26T17:33:48 <johill> for fear of people thinking it might change if the object gets renamed
2008-05-26T17:33:56 <dreimark> max-age has to be integer
2008-05-26T17:34:01 <johill> (which would be doable, but expensive)
2008-05-26T17:34:09 <johill> dreimark: hmm, isn't it?
2008-05-26T17:34:35 <dreimark> no currently it is expires - time.time()
2008-05-26T17:34:44 <dreimark> which is float
2008-05-26T17:34:59 <johill> oh
2008-05-26T17:35:24 <dreimark> will commit it
2008-05-26T17:36:24 <dreimark> lets see if this is a fix for the other cookie problem too
2008-05-26T17:36:35 <johill> ok, thanks for debugging it
2008-05-26T17:38:47 <johill> what other problem?
2008-05-26T17:41:48 <CIA-50> Reimar Bauer <rb.proj AT googlemail DOT com> default * 3644:68da15c7eeec 1.7/MoinMoin/session.py: session._set.cookie: lifetime needs to be integer bug fix for 1.7NoSessionCookieCreatedOnKonqueror
2008-05-26T17:43:24 <dreimark> johill: http://moinmo.in/MoinMoinBugs/CookieBlocksLogin
2008-05-26T17:43:48 <dreimark> but probably not because that was on 1.6
2008-05-26T17:44:59 * dreimark has to reboot
2008-05-26T17:53:08 <dreimark> arrgh seems I better get a new clone
2008-05-26T17:53:27 <dreimark> all this reverts do have created those old SERVER files again
2008-05-26T17:53:38 <dreimark> and revert --all doesn't remove them
2008-05-26T17:54:09 <dreimark> and now I have lots of failing tests
2008-05-26T18:29:20 <dreimark> bbl
2008-05-26T18:40:46 <PawelPacana> dennda: I updated project page, so you colud take a glimpse or better subscribe
2008-05-26T18:43:48 <johill> PawelPacana: what page is it?
2008-05-26T18:44:26 <TheSheep> PawelPacana/MercurialBackend
2008-05-26T18:46:44 <TheSheep> johill:is the user information also versioned?
2008-05-26T18:47:10 <TheSheep> is the backend also responsible for storing cache?
2008-05-26T18:47:31 <TheSheep> dennda: ?
2008-05-26T18:47:48 <xorAxAx> TheSheep: the caching will mgirate to the storage interface one day
2008-05-26T18:51:19 <TheSheep> xorAxAx: but not for now?
2008-05-26T18:52:32 <johill> TheSheep: no, user info isn't versioned
2008-05-26T18:54:19 <TheSheep> johill: thnaks
2008-05-26T18:54:40 <johill> TheSheep: I don't think the tree-view could be 'an extra plugin', the fact that things are no longer linear probably needs to be known throughout
2008-05-26T18:55:11 <johill> I mean, the view can still be separate, but it makes less sense if the other code needs to know about non-linear history anyway
2008-05-26T18:55:18 <johill> though maybe we just want to linearise it
2008-05-26T18:56:27 <johill> TheSheep, PawelPacana: what about item metadata? that is not revisioned
2008-05-26T18:57:14 <johill> "ignore rules for cache and the like" - not really, dennda will hav to remove that from there anyway
2008-05-26T18:58:50 <TheSheep> johill: metadata is not versioned?
2008-05-26T18:58:58 <TheSheep> how quaint
2008-05-26T18:59:07 <johill> _item_ metadata is not versioned
2008-05-26T18:59:12 <johill> _revision_ metadata is versioned
2008-05-26T18:59:23 <johill> _item_ metadata is used for things like soft edit locks
2008-05-26T18:59:39 <TheSheep> wait a minut, I need to untangle these two concepts in my mind, I had them collapsed together
2008-05-26T18:59:54 <johill> figured
2008-05-26T19:00:13 <johill> an item has: a name (key), metadata, revisions
2008-05-26T19:00:15 <TheSheep> so we have a dict per item, and additionally a dict per revision?
2008-05-26T19:00:23 <johill> a revision has: a revision number, metadata, data
2008-05-26T19:00:25 <johill> yes
2008-05-26T19:00:34 <johill> a revision is immutable once it hits storage
2008-05-26T19:00:42 <johill> the item metadata is, however, mutable
2008-05-26T19:01:03 <johill> item metadata is rarely used, only for edit locking at the moment, and shouldn't be used for much
2008-05-26T19:01:08 <TheSheep> ok, s if we keep the revision metdata in a file, we can just version it together with the item content
2008-05-26T19:01:23 <johill> only for things that are truly per item, not per revision, and most things are per revision
2008-05-26T19:01:26 <johill> yeah sure
2008-05-26T19:02:05 <johill> but item metadata is mutable
2008-05-26T19:02:19 <johill> I guess you still have to check it in all the time
2008-05-26T19:04:25 <johill> TheSheep: oh yeah, all user information lives in an item that has no revisions
2008-05-26T19:04:44 <johill> TheSheep: well, /will/, dennda will change that from the current 'lives in a single mutable revision', but we discussed that
2008-05-26T19:08:32 * johill adds a few comments
2008-05-26T19:14:08 <johill> TheSheep: does that help?
2008-05-26T19:15:51 <johill> TheSheep, PawelPacana: you may also want to think about the rename problem.. it would be sad to have a backend that has the same problems as the current fs backend
2008-05-26T19:18:18 <TheSheep> johill: hg tracks renames
2008-05-26T19:18:50 <TheSheep> johill: so, some revisions will be available in two places
2008-05-26T19:20:18 <johill> hmm
2008-05-26T19:20:41 <johill> no, I was thinking of a different problem I think
2008-05-26T19:20:57 <johill> say you have code that displays the current revisiion's metadata
2008-05-26T19:21:00 <johill> it looks like this:
2008-05-26T19:21:08 <johill> item = backend.get_item('test')
2008-05-26T19:21:13 <johill> rev = item[-1]
2008-05-26T19:21:19 <johill> display(rev.metadata)
2008-05-26T19:21:44 <johill> now, if between line 2 and 3 the item is renamed, what happens?
2008-05-26T19:22:33 <johill> oh wait, that's not really a problem
2008-05-26T19:22:38 <johill> assume it gets renamed between 1 and 2
2008-05-26T19:25:56 <TheSheep> well, as soon as you do get_item, you have a change context object inside it that's bound to the file's id in the repository
2008-05-26T19:26:28 <TheSheep> the file id doesn't change
2008-05-26T19:27:09 <TheSheep> so the change context object will allow you to access the revisions of both the pre-rename and post-rename filenames
2008-05-26T19:27:21 <johill> ok
2008-05-26T19:27:34 <johill> sounds good
2008-05-26T19:27:35 <TheSheep> s/change context/file context
2008-05-26T19:27:37 <TheSheep> sorry
2008-05-26T19:27:41 <johill> just make sure you do bind a context to it
2008-05-26T19:27:58 * TheSheep makes a note on the page
2008-05-26T19:29:08 <johill> once dennda refactors, of course, not possible before that
2008-05-26T19:35:33 <dennda> johill: You don't want a name property on items?
2008-05-26T19:36:10 <johill> dennda: I'm thinking that normally you won't need it
2008-05-26T19:36:23 <johill> dennda: and if it's there, somebody might expect it to change if a concurrent rename happens
2008-05-26T19:36:28 <dennda> Because if you already got the item you must have known its name?
2008-05-26T19:36:31 <johill> which would certainly be possible to implement
2008-05-26T19:36:35 <johill> yeah
2008-05-26T19:36:41 <dennda> well... item.get_name()?
2008-05-26T19:37:47 <johill> possible, sure, but when would anyone care? I was thinking that if it's there people will use it not thinking that it can be quite expensive due to the rename checking
2008-05-26T19:38:41 <dennda> yes
2008-05-26T19:38:57 <dennda> We are in the lucky position to have PawelPacana test our api design while we are at it :)
2008-05-26T19:39:06 <dennda> So if he feels something is missing he can just tell us
2008-05-26T19:39:39 <johill> yeah :)
2008-05-26T19:40:32 <johill> hm. maybe rename should take (item, newname)
2008-05-26T19:40:40 <dennda> johill: I still have some questions, but I suggest I do what I can do (and understand) now and come up with a summary of all the problems and questions I encountered while doing so
2008-05-26T19:41:01 <dennda> let me think about that
2008-05-26T19:41:09 <johill> whatever floats your boat
2008-05-26T19:41:28 <dennda> nice idiom
2008-05-26T19:42:21 <dennda> johill: I feel that rename_item(item, newname) is a bit more secure
2008-05-26T19:42:34 <johill> yeah
2008-05-26T19:42:39 <dennda> Since you cannot accidentially rename an Item by passing a wrong oldname
2008-05-26T19:42:46 <dennda> (well, you could still pass a wrong Item)
2008-05-26T19:42:55 <johill> yeah and fits the api better to operate on items
2008-05-26T19:43:03 <dennda> let's do it then
2008-05-26T19:43:15 <johill> maybe it should even be item.set_name() but that might be a tad too hidden
2008-05-26T19:43:44 <dennda> That also keeps me from checking if the item exists and raising an exception if that is not the case
2008-05-26T19:44:08 <johill> "keeps you"? in what way?
2008-05-26T19:44:10 <dennda> rename_item fits better into my "naming convention" :)
2008-05-26T19:44:35 <dennda> s/me/whoever writes a specific backend/
2008-05-26T19:44:37 <johill> right
2008-05-26T19:44:56 <johill> but item.rename() might fit better into the pattern that all item operations are done with the item?
2008-05-26T19:45:26 <johill> (and I guess it would call out to backend._rename_item() internally by default)
2008-05-26T19:45:42 <dennda> yes, or the other way around
2008-05-26T19:46:18 <johill> this way is how everything else is though
2008-05-26T19:46:44 <dennda> by the way
2008-05-26T19:46:58 <johill> so that might be more sensible because it follows the strategy laid out by the other methods
2008-05-26T19:47:04 <dennda> Is there any need for _rename_item()? What's the difference between that and rename_item()?
2008-05-26T19:47:30 <johill> well I was thinking of removing rename_item() then
2008-05-26T19:47:43 <johill> so that the rename operation goes with the item instead of the backend
2008-05-26T19:47:56 <johill> like save, create_revision, ...
2008-05-26T19:48:49 <dennda> How does the item know the backend that defines _rename_item()?
2008-05-26T19:49:30 <johill> hmm?
2008-05-26T19:49:40 <johill> the backend instantiates an item and passes itself to it
2008-05-26T19:50:45 <johill> I mean, we wanted to do the same for a lot of item methods too anyway
2008-05-26T19:51:19 <dennda> lemme try to get my head around that
2008-05-26T19:51:34 <johill> say you have get_item:
2008-05-26T19:51:38 <johill> def get_item(name):
2008-05-26T19:51:43 <johill> # do some lookups, ...
2008-05-26T19:51:44 <dennda> So the Item memorizes to which backend it belongs?
2008-05-26T19:51:54 <johill> yeah
2008-05-26T19:51:58 <johill> sorry again
2008-05-26T19:52:09 <johill> def get_item(self, name):
2008-05-26T19:52:26 <johill> result = Item(self)
2008-05-26T19:52:32 <johill> # ...
2008-05-26T19:52:34 <johill> return result
2008-05-26T19:52:44 <johill> Item.save would be
2008-05-26T19:52:48 <johill> def save(self):
2008-05-26T19:52:59 <johill> self._backend._item_save(self)
2008-05-26T19:53:19 <johill> which is just provided for convenience to the backend implementor
2008-05-26T19:53:32 <johill> that's what I thought anyway
2008-05-26T19:53:45 <johill> it makes all operations be on the "right object" so to speak
2008-05-26T19:54:00 <johill> i.e. no need to do "backend.item_do_something(item)"
2008-05-26T19:54:07 <johill> but rather "item.do_something())
2008-05-26T19:54:17 <johill> while still allowing the implementor to just write a single class
2008-05-26T19:54:59 <johill> and then it just makes sense to have item.rename(newname)
2008-05-26T19:55:00 <dennda> Just to get this right: There won't be any "my_backend_is = SQLBackend" or some similar attribute within the item objects, right?
2008-05-26T19:55:17 <johill> no
2008-05-26T19:55:24 <johill> let me write a few lines of code
2008-05-26T19:55:29 <dennda> Ok
2008-05-26T19:55:34 <dennda> paste.pocoo.org is your friend :)
2008-05-26T19:59:52 <johill> sloow network
2008-05-26T20:00:01 <dennda> hehe
2008-05-26T20:00:20 <johill> http://paste.pocoo.org/show/54178/
2008-05-26T20:01:05 <johill> this way, the public API is
2008-05-26T20:01:10 <johill> item = backend.get_item('asdf')
2008-05-26T20:01:18 <johill> item.rename('finally a sensible name')
2008-05-26T20:01:25 <johill> but internally it's all done in the backend
2008-05-26T20:01:29 <johill> same for the other methods
2008-05-26T20:02:16 <johill> the alternative would be
2008-05-26T20:04:25 <johill> http://paste.pocoo.org/show/54181/
2008-05-26T20:04:31 <dennda> Yes, got the former
2008-05-26T20:04:32 <johill> both are well possible
2008-05-26T20:05:59 <johill> I'd see the 'via backend' indirection version as the lazy shortcut for backend programmers
2008-05-26T20:06:14 <johill> but it does make sense to be that lazy
2008-05-26T20:06:27 <johill> (e.g. the get_cursor_somehow()
2008-05-26T20:06:32 <johill> has to ask the backend anyway)
2008-05-26T20:06:38 <dennda> yes
2008-05-26T20:06:47 <dennda> I got that
2008-05-26T20:07:03 <johill> :)
2008-05-26T20:07:19 <dennda> I guess you will review my code?
2008-05-26T20:07:33 <johill> sure
2008-05-26T20:07:51 <johill> how did we get here then?
2008-05-26T20:08:15 <dennda> hm?
2008-05-26T20:08:18 <johill> I mean, what was your question? did I misunderstand you completely?
2008-05-26T20:08:42 <dennda> Oh, well. No.
2008-05-26T20:08:56 <dennda> I just had a little confusion which is hopefully gone now
2008-05-26T20:09:12 <johill> ok :)
2008-05-26T20:09:19 <johill> another thought I jsut had wrt. naming
2008-05-26T20:09:23 <dennda> But be sure to be annoyed by other questions :)
2008-05-26T20:09:40 <johill> it might make sense to have the internal helpers all called _item or _revision
2008-05-26T20:09:49 <johill> i.e. _item_rename(item, newname)
2008-05-26T20:10:01 <johill> _revision_get_metadata(revision)
2008-05-26T20:10:11 <dennda> well, I did it the other way around with the public ones
2008-05-26T20:10:19 <johill> yeah works too
2008-05-26T20:10:23 <dennda> create_item, rename_item, get_item
2008-05-26T20:10:25 <dennda> ...
2008-05-26T20:10:25 <johill> but I think I was inconsistent
2008-05-26T20:10:30 <dennda> yes, you were
2008-05-26T20:10:35 <dennda> Shame on you! :)
2008-05-26T20:10:37 <johill> :)
2008-05-26T20:11:12 <dennda> I like it when the codes reads like prose
2008-05-26T20:11:18 <dennda> that's what that funny guy said
2008-05-26T20:11:29 <dennda> (But I liked it before he said that, too)
2008-05-26T20:11:42 <johill> hehe yeah
2008-05-26T20:12:09 <johill> yeah I think many of the things he said are pretty common knowledge anyway, except maybe with java programmers ;)
2008-05-26T20:12:42 <johill> of course, judging from the recent flameware about firmware names in the linux kernel, ...
2008-05-26T20:12:51 <dreimark> TheSheep: we will need a storage backend for the caching framework too - afterwards
2008-05-26T20:13:20 <johill> dreimark, TheSheep: but only after refactoring, no use doing that now, and it won't be hard either
2008-05-26T20:13:44 <dennda> johill: shall I remove backend.rename_item() then?
2008-05-26T20:13:58 <dennda> And rather make it item.rename()?
2008-05-26T20:14:04 <johill> yeah I think so
2008-05-26T20:14:22 <johill> fewer parameters to get wrong ;)
2008-05-26T20:14:25 <dennda> yes
2008-05-26T20:14:46 <TheSheep> just aloose thought, maybe you want to get a look at the api of some vcs? I mean, they try to deal with a similar problem, you might get some ideas from them
2008-05-26T20:15:09 <TheSheep> the bzr api is pretty well documented
2008-05-26T20:15:11 <johill> dunno
2008-05-26T20:15:23 <johill> VCSes assume no concurrent threads are running
2008-05-26T20:15:29 <johill> many
2008-05-26T20:16:15 <TheSheep> johill: I have only looked at the sources of hg, bzr and git, and they are all pretty paranoid about race conditions and locks and whatnot
2008-05-26T20:17:10 <johill> good :)
2008-05-26T20:17:55 <dennda> yay! My parents get DSL 20.000 this week
2008-05-26T20:17:56 <dennda> :)
2008-05-26T20:18:06 <dennda> That's even faster than my 16.000
2008-05-26T20:18:15 <johill> I didn't even know that existed
2008-05-26T20:18:20 <johill> my parents can't get >3k
2008-05-26T20:18:20 <dennda> Me neither
2008-05-26T20:18:36 <dennda> We couldn't get DSL at all a few years back
2008-05-26T20:18:40 <johill> ("technical limitations")
2008-05-26T20:18:47 <dennda> My granny, living three houses down the road, could
2008-05-26T20:18:55 <johill> fun
2008-05-26T20:19:03 <johill> (so you did a wireless link?)
2008-05-26T20:19:03 <dennda> well... I got two routers and set up a wireless bridge
2008-05-26T20:19:09 <dennda> worked flawlessly
2008-05-26T20:19:10 <dennda> yes :)
2008-05-26T20:19:12 <johill> :)
2008-05-26T20:19:24 <dennda> except it was only what they call "dsl light"
2008-05-26T20:20:26 <johill> my parent's neighbour used to have a modem until a few years ago he stopped using his computer
2008-05-26T20:20:45 <johill> we had dsl even when he *bought* his computer
2008-05-26T20:20:50 <dennda> johill: I need a short description of what an Item is for the docstring of that class. Can you come up with one?
2008-05-26T20:21:12 <johill> hm
2008-05-26T20:22:22 <johill> "An Item object collects the information of an item (e.g. page) that is stored in persistent storage. It has metadata and revisions."
2008-05-26T20:22:26 <johill> dunno
2008-05-26T20:22:38 <johill> maybe "(mutable) metadata"
2008-05-26T20:23:29 <dennda> Wasn't that an elegant way of asking what an Item basically is? :)
2008-05-26T20:23:42 <johill> heh
2008-05-26T20:23:52 <johill> anybody disagree? :)
2008-05-26T20:25:18 <dennda> So an item is... basically everything? Is there anything else on the same "level" as an item?
2008-05-26T20:25:44 <johill> no
2008-05-26T20:25:59 <johill> revisions are within an item, and backends above, of course
2008-05-26T20:26:12 <dennda> well
2008-05-26T20:26:26 <dennda> Now it sounds trivially easy
2008-05-26T20:26:35 <TheSheep> I'm wondering about what you said about storing users in an item
2008-05-26T20:26:46 <johill> TheSheep: we do that now in the storage branch, but wrongly
2008-05-26T20:26:53 <dennda> hah! he think's it's immoral too!
2008-05-26T20:26:54 <dennda> :)
2008-05-26T20:27:00 <TheSheep> johill: as special item name? or some other magic?
2008-05-26T20:27:16 <johill> TheSheep: actually, they still have the same names as the user IDs
2008-05-26T20:27:30 <johill> so the item name is actually '1206121441.9.18746'
2008-05-26T20:27:39 <TheSheep> johill: ah, so they are just home pages with additional metadata?
2008-05-26T20:27:39 <johill> and it only has metadata, where 'name' is one key
2008-05-26T20:27:47 <johill> no, they don't show up in the wiki namespace
2008-05-26T20:27:48 <TheSheep> ah, no
2008-05-26T20:27:59 <johill> they are in a separate backend
2008-05-26T20:28:02 <TheSheep> so how do you recognize them?
2008-05-26T20:28:07 <johill> i.e. you configure both the page and the user storage
2008-05-26T20:28:19 <johill> they aren't even in the same storage
2008-05-26T20:28:28 <TheSheep> you have a separate get_user_item and get_item?
2008-05-26T20:28:33 <johill> no
2008-05-26T20:28:38 <johill> you have a complete separate backend for users
2008-05-26T20:28:49 <johill> e.g.
2008-05-26T20:28:57 <johill> class Config(..):
2008-05-26T20:29:11 <johill> user_backend = Moin16CompatUserStorage()
2008-05-26T20:29:18 <johill> page_backend = SQLBackend()
2008-05-26T20:29:21 <johill> or something like that anyway
2008-05-26T20:29:25 <TheSheep> aah, makes sense
2008-05-26T20:29:40 <johill> and caches would use a third backend, in the future, I expect
2008-05-26T20:29:42 <TheSheep> I guess cache would be done in a similar way?
2008-05-26T20:29:46 <TheSheep> right
2008-05-26T20:29:47 <johill> heh :)
2008-05-26T20:30:10 <TheSheep> get out of my head!
2008-05-26T20:30:44 <TheSheep> johill: and psst, don't tell anyone what you saw there, ok?
2008-05-26T20:31:00 * johill crawls out and swears silence
2008-05-26T20:31:24 <johill> we should have this info publically available ;)
2008-05-26T20:35:09 <dennda> johill: http://paste.pocoo.org/show/54191/
2008-05-26T20:35:18 <dennda> Happy with that description or is there something wrong with it
2008-05-26T20:36:48 <johill> "A Revision is a snapshot of an Item at one specific point."
2008-05-26T20:36:52 <johill> that's not true
2008-05-26T20:37:20 <dennda> Ok, correct me
2008-05-26T20:37:32 <johill> a revision isn't a snapshot of an item, it's an object in its own right
2008-05-26T20:37:51 <dennda> Could you give an example?
2008-05-26T20:37:58 <johill> a revision has metadata and data
2008-05-26T20:37:59 <johill> well
2008-05-26T20:38:00 <johill> a page
2008-05-26T20:38:14 <johill> the item has no page content at all
2008-05-26T20:38:26 <johill> but it can have revisions, each having content
2008-05-26T20:38:39 <johill> so as the page changes, the page item gets more and more revisions with the respective contents
2008-05-26T20:38:42 <dennda> sure
2008-05-26T20:38:53 <johill> but e.g. the page metadata also doesn't contain who created it
2008-05-26T20:39:10 <johill> that information would be identical to the creator of the first revision
2008-05-26T20:39:12 <dennda> so just check who created the first revision?
2008-05-26T20:39:14 <dennda> yep
2008-05-26T20:39:33 <johill> item metadata you can mostly ignore in the context of actual pages
2008-05-26T20:39:44 <johill> in user storage, everything is in the item's metadata, there are no revisions
2008-05-26T20:40:13 <johill> (though, an interesting excercise in the future could be to put homepages there so they follow user renaming etc.)
2008-05-26T20:40:38 <johill> (i.e. do what TheSheep just thought we did already, store user info in the homepage metadata)
2008-05-26T20:40:52 <johill> but I digress
2008-05-26T20:40:53 <dennda> Ok so this would be a better explanation?: "An Item is a collection of Revisions which contain the content for the Item. The last Revision represents the most recent contents. An Item can have Metadata as well as Revisions."
2008-05-26T20:41:04 <johill> yeah
2008-05-26T20:41:17 <TheSheep> there are no-revision items too
2008-05-26T20:41:19 <dennda> Ok
2008-05-26T20:41:27 <TheSheep> "a collection of 0 or more revisions" ;)
2008-05-26T20:41:30 <johill> mind you, another very fundamental property is that revisions are immutable
2008-05-26T20:41:33 <dennda> johill: I think I will ad that at the top of the module
2008-05-26T20:41:36 <johill> while items are not
2008-05-26T20:41:50 <dennda> That's very valuable info if you want to understand the concept we are dealing with
2008-05-26T20:41:54 <johill> yeah
2008-05-26T20:42:08 <dennda> That helped me quite a lot now. (Hopefully) finally made clear the relationship
2008-05-26T20:42:21 <johill> I expect you'll flesh it out as time goes by and you have the concepts more in your blood ;)
2008-05-26T20:42:51 <dennda> Well, I hope so. But I first need to get used to all that stuff
2008-05-26T20:43:00 <johill> sure
2008-05-26T20:43:11 <johill> I started the other way around
2008-05-26T20:43:41 <dennda> So now I'll split up work and fun. I'm gonna lift some barbells, write some lines of code, barbells, code, barbells... (You decide what work and what fun is :))
2008-05-26T20:43:53 <johill> lanius has most of this, but for example got the immutability properties wrong
2008-05-26T20:43:55 <dennda> If I don't respond for some time please assume I am dead.
2008-05-26T20:44:12 <dennda> (If that happens, you may suspect that a barbell crushed my head)
2008-05-26T20:44:23 <dennda> :)
2008-05-26T20:44:46 <johill> heh. make 'em heavier if you can throw them that high ;)
2008-05-26T20:47:23 <johill> ohh shiny. there *is* a python git binding after all
2008-05-26T20:47:28 <dennda> I don't throw them, I push them
2008-05-26T20:48:10 <TheSheep> johill: yes, but a work in progress still
2008-05-26T20:48:38 <TheSheep> johill: I'm waiting for it to get stable to make another backend for my toy wiki :)
2008-05-26T20:48:54 <johill> :)
2008-05-26T20:49:43 <johill> TheSheep: http://blog.michaeltrier.com/2008/5/8/gitpython that one?
2008-05-26T20:50:04 <johill> I found that other one part of the git-issue thingie that looked less fleshed out
2008-05-26T20:50:21 <TheSheep> yes
2008-05-26T20:50:35 <TheSheep> that's the one I've been pointed to
2008-05-26T20:50:43 <TheSheep> (I'm not following git for some reason)
2008-05-26T20:51:45 <TheSheep> >>> from git_python import * <--- aaargh!
2008-05-26T20:53:11 <johill> yeah just found that too
2008-05-26T20:53:29 <johill> nothing that couldn't be cleaned up :)
2008-05-26T20:53:56 <TheSheep> sure, but the attitude...
2008-05-26T20:54:03 <dennda> anyone know wicd?
2008-05-26T20:54:17 <dennda> _THAT_ code was aweful to look at
2008-05-26T20:54:51 <johill> never heard of
2008-05-26T20:54:53 <dennda> while True:
2008-05-26T20:54:57 <dennda> if foo:
2008-05-26T20:55:03 <dennda> print "asd"
2008-05-26T20:55:06 <dennda> #endif
2008-05-26T20:55:08 <TheSheep> johill: although I would really appreciate a similar blog post about hg, discovering all this in console is pretty tedious
2008-05-26T20:55:09 <dennda> #endwhile
2008-05-26T20:55:18 <johill> dennda: haha
2008-05-26T20:55:24 <johill> TheSheep: heh, ask #mercurial
2008-05-26T20:55:26 <dennda> and much more evil stuff
2008-05-26T20:55:38 <dennda> johill: it's something similar to network-manager
2008-05-26T20:55:43 <dennda> I assume you know that one?
2008-05-26T20:56:16 <johill> dennda: yeah I know that, had a few beers with the lead developer :)
2008-05-26T20:56:18 <TheSheep> "I don't relly lik python but if we really have to write in it, ok"
2008-05-26T20:56:33 <johill> and I expect I will again in July :)
2008-05-26T20:57:16 <johill> anyone know what test.testlib.patch is?
2008-05-26T20:57:28 <johill> @patch(Git, 'method_missing')
2008-05-26T20:57:28 <johill> def test_heads_should_populate_head_data(self, git):
2008-05-26T20:58:02 <TheSheep> no idea
2008-05-26T20:58:09 <johill> oh wait it's in this project, doh
2008-05-26T20:59:51 <johill> but hmm where is that decorator declared?
2008-05-26T21:00:25 <TheSheep> that's hwat you get for using *
2008-05-26T21:00:31 <dennda> haha
2008-05-26T21:01:13 <johill> how do you even declare decorators?
2008-05-26T21:01:29 <TheSheep> johill: they are normal functions
2008-05-26T21:01:44 <johill> there is no patch function
2008-05-26T21:01:45 <TheSheep> johill: they take a function as argument and return a function
2008-05-26T21:01:57 * johill is confused
2008-05-26T21:03:50 <johill> ah
2008-05-26T21:03:55 <johill> his testing module does a * import too
2008-05-26T21:04:02 <johill> gross
2008-05-26T21:05:15 <dennda> wow, I knew something about python johill didn't know :)
2008-05-26T21:05:19 <dennda> (the decorator thing)
2008-05-26T21:05:32 <johill> oh there's probably lots
2008-05-26T21:05:40 <johill> I never bothered to follow the new python developments
2008-05-26T21:06:45 <johill> phh. the 'mock' module he uses isn't even in debian ;)
2008-05-26T21:07:31 <dreimark> arnica runs on the XO very well :) (now I have a problem with 1GB)
2008-05-26T21:07:50 <johill> TheSheep: to be fair, his library doesn't use * imports, at least I haven't found nay yet
2008-05-26T21:08:20 <johill> oh it does, utils
2008-05-26T21:09:53 <dennda> sheesh
2008-05-26T21:09:55 <dennda> that hurt
2008-05-26T21:10:08 <dennda> too much weights and no one around to help lift it
2008-05-26T21:10:37 <TheSheep> dreimark: who's arnica?
2008-05-26T21:10:43 <dennda> note to self: never take too much weights if no one is around or your stomach will ache when you try to get rid of the barbell
2008-05-26T21:10:57 <johill> TheSheep: heh. it's the image gallery parser
2008-05-26T21:11:29 <johill> dreimark: why would you want to? to see hhow fast it is?
2008-05-26T21:14:14 <TheSheep> omg, overloading the / operator to make it possible to have storage/"file name"
2008-05-26T21:14:18 <TheSheep> evil
2008-05-26T21:14:29 <johill> huh? where
2008-05-26T21:14:51 <TheSheep> johill: the exaples in that blog post
2008-05-26T21:14:55 <dreimark> johill: yeah and I was surprised how fast it is there
2008-05-26T21:15:10 <TheSheep> johill: 12th from the top
2008-05-26T21:15:44 <dreimark> johill: yeah and I was surprised how fast it is running there
2008-05-26T21:15:53 <johill> TheSheep: oh yeah I see
2008-05-26T21:15:58 <johill> def __div__(self, file):
2008-05-26T21:16:40 <TheSheep> and if you return an object with overloaded / itself, you can build paths...
2008-05-26T21:16:55 <johill> heh
2008-05-26T21:17:01 <TheSheep> good thing python doesn't allow : in names
2008-05-26T21:17:06 <johill> well it does return a tree again
2008-05-26T21:17:10 <johill> so yes, you can do that
2008-05-26T21:17:24 <TheSheep> this is wrong
2008-05-26T21:17:28 <TheSheep> soo wrong
2008-05-26T21:17:39 <johill> that is ugly, yeah, I agree
2008-05-26T21:19:04 <johill> well a git librification effort was (is?) under way
2008-05-26T21:19:10 <johill> so maybe one can just bind it in python then
2008-05-26T21:23:20 <johill> bbl, phone
2008-05-26T21:51:28 <dennda> johill: Why does _create_revision(self, item, revno) take revno as argument?
2008-05-26T21:51:29 <xorAxAx> TheSheep: well, somebody has to do it :-)
2008-05-26T21:51:40 <dennda> imho it should default to the next number following
2008-05-26T21:51:47 <dennda> assuming you meant "revision number" with revno
2008-05-26T21:52:05 <johill> I did, and taking the net one doesn't work
2008-05-26T21:52:07 <johill> next
2008-05-26T21:52:17 <dennda> why is that?
2008-05-26T21:52:31 <johill> to detect if somebody else concurrently created one
2008-05-26T21:52:38 <johill> makes it easier to check for edit conflicts I think
2008-05-26T21:52:57 <dennda> hmm
2008-05-26T21:53:00 <johill> (otherwise you have to do something like
2008-05-26T21:53:05 <johill> rev = new_rev()
2008-05-26T21:53:06 <dennda> but it makes the API a bit more annoying, imho
2008-05-26T21:53:11 <dennda> isn't there another way?
2008-05-26T21:53:19 <johill> if rev.revno != old_rev_no+1: fail
2008-05-26T21:54:02 <johill> the other way forces the error, it fails w/o you doing anything more than what you must (since you need to pass the revno you want)
2008-05-26T21:54:42 <TheSheep> johill: well, I want to just merge in such a case with the hg backend
2008-05-26T21:54:54 <TheSheep> johill: so the "parent" revision would be useful
2008-05-26T21:55:19 <johill> hmm
2008-05-26T21:55:33 <TheSheep> johill: then again, to avoid race conditions, I would prefer a revision object instead of a number
2008-05-26T21:55:56 <TheSheep> johill: maybe revision.update() :)
2008-05-26T21:56:05 <johill> eh, revisinos are immutable :)
2008-05-26T21:56:56 <TheSheep> revision.make_new_one_with_this_one_as_parent()
2008-05-26T21:57:24 <dennda> what a lovely name for a function... so... concise! :)
2008-05-26T21:57:54 <TheSheep> _and_hurry_up_will_ya_dont_have_a_whole_day_I_hate_those_backends
2008-05-26T21:59:06 <dennda> :)
2008-05-26T21:59:12 <dennda> that'd be funny
2008-05-26T21:59:28 <dennda> i'd love to see peoples faces when they MUST use that API
2008-05-26T21:59:53 <johill> heh
2008-05-26T22:00:17 <TheSheep> I little grumpiness didn't kill anybody
2008-05-26T22:02:31 <johill> TheSheep: moin already merges, no?
2008-05-26T22:03:10 <johill> dennda: look at LOCKFREE, it catches a RevisionExists exception
2008-05-26T22:03:19 <johill> but I'm open to better ideas
2008-05-26T22:04:16 <dennda> johill: I didn't think about concurrency
2008-05-26T22:04:23 <dennda> johill: I think you have a point there
2008-05-26T22:04:45 <johill> the way I thought you'd use it is to have the old revision number in a hidden form field
2008-05-26T22:05:52 <dennda> form field?
2008-05-26T22:06:12 <johill> for the page editor form
2008-05-26T22:06:18 <johill> web stuff, you know? :)
2008-05-26T22:09:00 <TheSheep> that's usually how you do it
2008-05-26T22:09:16 <TheSheep> and when saving, you know which version it was that was edited
2008-05-26T22:09:22 <TheSheep> so you can do a merge
2008-05-26T22:09:39 <johill> yes, but the fast path is to just try to save n+1
2008-05-26T22:09:46 <johill> and then you catch the exception and do the merge
2008-05-26T22:09:52 <johill> at least that's what I thought
2008-05-26T22:10:38 <TheSheep> you still need to know the n
2008-05-26T22:10:59 <johill> sure
2008-05-26T22:11:13 <johill> but that's why I added the revno parameter, so you just pass n+1 to it
2008-05-26T22:11:24 <johill> could pass 'n' and name it 'parent'
2008-05-26T22:11:37 <johill> that might be easier for hg if 'n' isn't an int
2008-05-26T22:11:42 <dennda> johill: and the new revision number is created when the revision is saved?
2008-05-26T22:11:44 <dennda> (not before)
2008-05-26T22:11:50 <johill> yeah
2008-05-26T22:11:59 <johill> oh
2008-05-26T22:12:45 <johill> well still you'd pass the number to create
2008-05-26T22:12:51 <johill> not to save, I'd think
2008-05-26T22:13:00 <dennda> hm
2008-05-26T22:13:17 <dennda> I'll go that through with an example after the next set
2008-05-26T22:13:22 <johill> actually, it's only created when the item is saved that contains the revision I think
2008-05-26T22:14:40 <johill> hmmm
2008-05-26T22:15:04 <johill> yeah so rollback/abort will have to remove the stored data again, in that case where it fails
2008-05-26T22:21:14 <dennda> johill: the question is: when do we want the revisions to clash?
2008-05-26T22:21:37 <dennda> When both concurrent writers save() the revision?
2008-05-26T22:22:03 <johill> not sure
2008-05-26T22:22:13 <johill> I never had any revision.save()
2008-05-26T22:22:22 <dennda> lemme think loudly
2008-05-26T22:22:26 <johill> because it only goes live when you item.save()
2008-05-26T22:22:35 <dennda> We have an Item I with currentrev = 3
2008-05-26T22:22:54 <dennda> how does the item know of the revision?
2008-05-26T22:22:58 <dennda> that is to be saved?
2008-05-26T22:23:14 <johill> well it can memoize that since you say item.create_revision
2008-05-26T22:23:24 <dennda> hmm
2008-05-26T22:23:29 <dennda> I'm not sure what I think of that
2008-05-26T22:23:38 <dennda> lemme do another set and then decide :)
2008-05-26T22:26:51 <dennda> johill: That'd mean that you already have all the contents of the revision that is to be saved when invoking create_revision
2008-05-26T22:27:06 <dennda> but I think that's how it was meant to be
2008-05-26T22:28:48 <johill> not quite maybe
2008-05-26T22:29:05 <johill> if you're receiving a post, you may still be receiving data at that point to stream it right into the db/file
2008-05-26T22:29:14 <johill> or a put?
2008-05-26T22:30:53 <dennda> I just saw a problem with that which I seem to have forgotten by now
2008-05-26T22:30:56 <dennda> lemme think again
2008-05-26T22:31:35 <dennda> so we got our Item I with currentrev = 3
2008-05-26T22:31:47 <dennda> user X says: create_revision(I, 4)
2008-05-26T22:31:50 <dennda> does stuff
2008-05-26T22:31:59 <dennda> Y says: create_revision(I, 4)
2008-05-26T22:32:01 <dennda> does stuff
2008-05-26T22:32:21 <dennda> X says: I.save()
2008-05-26T22:32:25 <dennda> rev 4 is saved
2008-05-26T22:32:39 <dennda> Y says: I.save()
2008-05-26T22:32:40 <dennda> clash!
2008-05-26T22:32:44 <johill> yeah
2008-05-26T22:32:55 <johill> Y says: I.abort()
2008-05-26T22:32:57 <johill> stuff is cleaned up
2008-05-26T22:32:59 <dennda> Y gets a message and is asked to merge the changes or undo them
2008-05-26T22:33:10 <dennda> doesn't Y have other options?
2008-05-26T22:33:26 <johill> well it should first abort the botched save, I'd think
2008-05-26T22:33:42 <johill> a merge would create a different revision anyway
2008-05-26T22:34:15 <dennda> abort sounded a bit like abort_and_lose_changes
2008-05-26T22:34:56 <dennda> i cannot recall the problem I just saw with that approach
2008-05-26T22:34:56 <johill> yes
2008-05-26T22:35:04 <dennda> need to write down my thoughts as I get them
2008-05-26T22:35:07 <johill> :)
2008-05-26T22:35:17 <johill> yeah I agree that this path is pretty expensive
2008-05-26T22:35:36 <johill> but it still seems less error-prone
2008-05-26T22:35:46 <dennda> yes
2008-05-26T22:36:02 <dennda> so what does abort() do?
2008-05-26T22:36:46 <johill> I expect it would kill all the pending revision data
2008-05-26T22:36:58 <johill> like maybe a temp file that would have been renamed into place by .save()
2008-05-26T22:39:46 <johill> not sure
2008-05-26T22:40:15 <johill> say you want to stream a large attachment in, you might want to fail before .save()
2008-05-26T22:40:16 <dennda> hmm
2008-05-26T22:40:46 <johill> I suppose create_revision could also check
2008-05-26T22:40:54 <johill> but save needs to check too to avoid races
2008-05-26T22:41:10 <johill> since you can't remove_revision, that's fine
2008-05-26T22:50:37 <dennda> needs quite some time and intelligence to get it right
2008-05-26T22:51:09 <johill> luckily, that's what we have you for :)
2008-05-26T22:54:29 <dennda> heh
2008-05-26T22:55:15 <dreimark> :)
2008-05-26T23:00:32 <johill> http://git.or.cz/gitwiki/GitFaq#head-9dfc528b189148e801031d161201645af532a580
2008-05-26T23:00:36 <johill> I really wish hg did that
2008-05-26T23:11:33 <johill> TheSheep: the /"..." stuff he stole from the ruby code too
2008-05-26T23:11:49 <johill> (cf. http://grit.rubyforge.org/)
2008-05-26T23:27:28 <johill> dennda: though if we want to stick to passing in a revno or similar to create_revision we may want to do what TheSheep suggested and pass in the parent revision
2008-05-26T23:27:59 <johill> the whole thing also means that we need to have a 'revision_id' property in a revision object, beucase you may have obtained it by using -1 to get the last revision
2008-05-26T23:28:56 <dennda> yep
2008-05-26T23:29:06 <dennda> passing the parent revision or the parent revisions number?
2008-05-26T23:29:56 <johill> not sure, but it seems that the revision number would be what you have at that point
2008-05-26T23:30:05 <johill> and adding an extra line of code to pass it in seems not useful
2008-05-26T23:30:14 <johill> ("reduce boilerplate code" ;) )
2008-05-26T23:31:39 <johill> also, at this point probably the last assumption that the revision number needs to be an integer falls
2008-05-26T23:33:06 <dennda> johill: yes, I agree
2008-05-26T23:40:21 <dennda> _list_revisions(itemobj) - returns number list
2008-05-26T23:40:33 <dennda> johill: number list? Why not a list of revisions?
2008-05-26T23:40:48 <johill> good question
2008-05-26T23:40:59 <johill> actually, I think that's because the number list is cheaper
2008-05-26T23:41:17 <johill> an iterator doesn't work for some rason (I forgot why, maybe it was just too much work)
2008-05-26T23:41:26 <johill> and there are no races since revisions are there forever
2008-05-26T23:42:38 <johill> and I suppose creating that many revision objects isn't a great idea
2008-05-26T23:42:47 <johill> but I'm just pulling these reasons out of thin air
2008-05-26T23:43:09 <johill> maybe it could be an iterator
2008-05-26T23:43:18 <johill> (that would make a lot of sense for the info action, at least)
2008-05-26T23:44:52 <TheSheep> johill: I'm ok with ints in mercurial, internally
2008-05-26T23:45:18 <johill> ok, but we still don't have to require the user adding 1 all the time
2008-05-26T23:45:22 <TheSheep> johill: inst identify revisions unanbigiously as long as you don't move them between repositories
2008-05-26T23:45:34 <johill> true
2008-05-26T23:45:36 <TheSheep> ints
2008-05-26T23:46:18 <TheSheep> I guess you want to pass whatever parameter you got form the edit form
2008-05-26T23:46:23 <TheSheep> with minimal processing
2008-05-26T23:47:08 <TheSheep> just a sanity check
2008-05-26T23:47:09 <johill> yeah
2008-05-26T23:48:42 <TheSheep> I wonder what the backend should do if it got a non-existing revision there
2008-05-26T23:49:14 <johill> fail, somehow
2008-05-26T23:49:33 <TheSheep> delete the whole database and attempt to fomat all the drives :D
2008-05-26T23:49:53 <TheSheep> I won't settle for anything less spectacular
2008-05-26T23:49:59 <johill> heh
2008-05-26T23:56:41 * dennda tries to get some sleep
2008-05-26T23:56:44 <dennda> good night
2008-05-26T23:57:08 <PawelPacana> dennda: gn
2008-05-26T23:57:39 <dreimark> gn dennda
2008-05-26T23:57:41 <johill> night
2008-05-26T23:57:52 <dreimark> hi gizmach
2008-05-26T23:57:52 <gizmach> dreimark: hi
2008-05-26T23:57:59 * dreimark was faster
2008-05-26T23:58:03 <gizmach> :)
2008-05-26T23:58:56 * gizmach is into her learning process for final exams :(
2008-05-26T23:59:16 <dreimark> oh
2008-05-26T23:59:27 <TheSheep> gizmach: get that neural net trained
2008-05-26T23:59:48 <gizmach> TheSheep: ?
2008-05-26T23:59:55 * gizmach confused
MoinMoin: MoinMoinChat/Logs/moin-dev/2008-05-26 (last edited 2008-05-25 22:15:02 by IrcLogImporter)