/srv/irclogs.ubuntu.com/2011/12/22/#bzr.txt

=== lifeless_ is now known as lifeless
poolie_hi vila07:21
vilapoolie_: hey, not fully here yet ;)07:21
poolie_i'm not fully gone, but i will07:21
poolie_be07:21
vilareading the thread about locales on python...07:21
vilafinger syndrom07:22
poolie_L07:22
poolie_?07:22
vilathe user is wrong, python is wrong, bzr get the finger :)07:22
poolie_i like the way python and linux are pointing at each other07:23
poolie_oh well07:23
poolie_Joyeux Noël07:23
fullermd_Linux?  People still use that thing?07:23
vilahttp://paste.ubuntu.com/778346/07:23
vilapoolie_: hehe, thanks :)07:24
=== fullermd_ is now known as fullermd
poolie_more seriously perhaps we should back out gz's hack07:26
poolie_anyhow07:26
poolie_night all07:26
fullermdMan, it sure did get quiet this week.08:14
vilaIt all happened while you slept ?08:19
fullermdAll sorts of things happen while I sleep.  Like, where did all the trilobites go?08:20
vilano doubt about that: australia08:25
jelmervila: let me know if you'd like to discus feature flags some more10:49
jelmerI've updated the docs10:50
vilaI'll look into it, I was reviewing switch-possible-transports and there are still 2 test failures :-/10:51
vilacomment posted10:51
jelmervila: switch-possible-transports has two prerequisites, one of which isn't approved either.. so there are other branches I'm more interested in tbh :)10:52
vilayeah, well...10:53
jelmervila: that's not to say I don't appreciate the review..11:01
vilaso, if the feature name is global, _present_features should contain all features provided by the installed code base (ie. bzr and plugins) right ?11:05
jelmeryep11:06
vilahmm, I was about to ask for some help associated with the feature but that's useless for features that are not "installed"11:06
vila(thinking out aloud)11:07
vilalock_write raises for write acces, but what about read access ?11:08
vilaif the format talks about feature, why does each line says feature ? Didn't we settle to put all features on the same line for each kind of necessity ? And consider all unknown necessities as required ?11:09
jelmervila: All unknown necessities are considered required by the existing code11:10
vila(given that when a plugin provides a feature it's present even if the necessity s unknown)11:10
jelmervila: I don't think we discussed the layout11:10
vilaha, misunderstanding then :)11:10
jelmervila: I agree there are in concept two lists at the moment - the optional and the required features11:11
vilaand optional additional lists for unknown necessities11:11
vilathe core issues are still the same whatever format we chose :)11:12
vilaI'm trying to agree with you on the simplest one that allows the most robust parser :)11:12
vilawe're close to a simple scanner and scanners are more robust than parsers11:13
jelmerwhat's the difference?11:13
vilawow, many11:14
vilaroughly a scanner doesn't need to take a context into account nor handle error recovery11:14
vilait sees a stream of text and split it into tokens11:14
vilaa parser sees a stream of tokens and recognizes more complex constructs11:15
jelmervila: right, I don't see how we can really avoid a parser?11:15
jelmerwe'll need one in either case, even if it's very simple11:15
vilaright, scanners are often called parsers even where there is no grammar to parse11:16
jelmerI think there is some really basic grammar here :)11:16
vilano, only tokens separated by spaces11:17
vilaand newlines11:17
jelmergrammar exists over those tokens11:17
vilawell, if you insist... but it's so trivial it doesn't need a parser11:18
jelmerwe only allow "optional feature foo", not "foo bar bla"11:18
vilaanyway, forget about the distinction11:18
jelmersure11:18
vilaI'd prefer: optional foo, bar11:18
vilarequired biz, bob11:18
vila'feature' is just noise here11:19
jelmervila: I've considered that as well, but it's less extendable in the future11:19
jelmerit doesn't allow adding extra data at the end (like per-feature parameters), or data other than features11:19
vilawe're back to the start of yesterday's discussion ?11:20
jelmermaybe a bit11:20
vilawe ruled out per-feature parameters are being under plugin responsibility11:20
vilaI fail to see why you want to open for data other than features on the basis that your actual parser is robust without desmonstrating that11:21
vilai.e. if you don't clarify the unknowns I can't see what you're talking about11:22
jelmervila: I don't want to make extension of the format file in the future impossible11:22
jelmerI can imagine us wanting to add other things to the format file than features, or to add more data per feature11:22
jelmer"optional index bar"11:23
vilasame as optional bar11:24
vilaindex is under bar responsibility11:24
jelmervila: no, because it's different from "optional feature bar"11:24
viladoes it change the fact that the format can be read if the feature is not there ?11:25
jelmervila: it's something entirely different, unrelated to features11:25
jelmervila: "bar" is not a feature in "optional index bar". it's something entirely different11:25
jelmervila: it can be read, as it's optional too - and the parser won't barf on that11:26
vilawhat's the API for that ?11:26
vilawho benefits from it ?11:26
jelmervila: there is no API, it's to allow future extension of the format file11:27
jelmervila: we didn't foresee features in the past, but the reason they're possible is that older versions of bzr read the entire format file, not just the first line11:28
jelmervila: I'd like to keep that flexibility present in case we have something similar in the future, that's why the format is a bit more verbose11:29
jelmervila: perhaps we can fold it into one line still, e.g.:11:29
jelmer"optional features = foo, bar, bla"11:29
jelmer"required features = blie"11:29
jelmerthat'll still be a bit ugly if there are going to be many and the line doesn't wrap, but I could live with that.. :)11:30
jelmerI do like it more verbose though, also because it means we can add more per-feature things in the future if we wanted to for some reason11:30
vilathat's a path I don't want to follow, you're opening a can of worms with no idea about what kind of worms will come out11:31
vilawhy ?11:31
jelmervila: how is this opening a can of worms?11:31
vilainterop, upgrades11:32
jelmerI'm not proposing we add anything else. I just don't want to paint ourselves into a corner.11:32
vilawhy don't you want to get out the corner we're in right now with small and safe steps ?11:33
jelmervila: we're not in a corner now - we have plenty of room to extend the existing format11:33
vila"anythin else" == the unknowns I'm referring to,11:33
vilaallowing optional features and required features is already a huge opportunity worth exploring with limited risks,11:34
vilawhat's the point of raising the risks ?11:34
jelmerhow is this raising the risks? I don't see how there are any additional risks unless we actually extend the format further.11:34
vilathen why allowing it ?11:34
jelmerThe only thing I want to prevent is that we can't extend it further if we want to, in the future.11:35
jelmerhow is that raising the risks?11:36
vilawe've already discussed that, I proposed an already supported format allowing a huge kind of tricks and we couldn't agree on what should be recognized there to allow a single backport11:36
viladesigning an extensible format is more than splitting lines (or hairs ;)11:37
vilaruling out ini format on the basis that it's too much overhead but not comparing it to an existing implementation... is questionable11:37
vilaand almost irrelevant until what is taken out from it clearly defined11:38
vilaand my understanding was that you wanted to extract only: is there a required feature there or something that should be considered like a required feature11:38
vilanothing else11:38
jelmervila: that is what I want to extract, and the only thing the current parser does today11:39
vilabut what guarantees does it offer that your unknown future additions will still be parsed and ignored or considered required ?11:40
jelmervila: it means we *can* add more stuff in the future apart from features, without having older clients blow up in our face too badly11:41
jelmerI have no idea what that stuff is, but it seems sensible to keep the option open11:42
vilameh, I'm saying your parser doesn't allow that while the ini format does and you're just replying: no11:42
vilahow can you say 'I have no idea' and 'without blowing' ?11:43
jelmervila: how does my parser not allow that? It allows opening things if there is a line that starts with "optional " that it doesn't understand11:43
jelmeranything that doesn't start with optional it *will* complain about11:44
jelmerso let's back up11:46
jelmeryou would prefer something like "Bzr format x\noptional foo,bar,bla\n" ?11:46
vilayes, preferably allowing 'required biz,bob\n' and everything else being handled as 'required you-can-t-represent-me-anyway'11:47
vilawhich give us the ability to support older bzr release and experimenting like mad with bzr.dev11:48
vilano doubt we will gather a lot of understanding11:49
jelmervila: could we do11:49
vilaone point I don't get:11:49
jelmer"required features biz,box\n" ?11:49
vilaare you trying to never require format bump at all ?11:49
vilas/ features// :-p11:49
jelmervila: I would really like to have the namespace just in case we need it11:50
jelmerI can understand the redundancy in having each feature on a separate line and repeating "optional feature ..."11:50
vilawe're adding one, you're asking for two or mores ;)11:50
vilameh, we're adding two: optional, required11:51
jelmervila: that's just one - they share a namespace11:52
vilameh again, yup11:52
jelmervila: we don't want to bail on everything we encounter that doesn't start with required or optional11:52
vilawith an attribute being 'optional, required' but let's add 'read-optional' at least :)11:52
vilawe won't bail, we will handle it as required11:53
vilaso even corruptions will be seen as required...11:53
jelmervila: but then we don't have the ability to ever extend the file again11:53
jelmerand this is why I would really like to have that word "features" in there11:53
vilawhat difference will that make for older bzrs ?11:53
vilanone if nothing is backported ?11:54
jelmervila: if we add something other than "features" in the future, but it's optional, they will know to ignore it11:54
vilawhy can't a plugin does that with only optional ?11:55
vilas/does/do/11:55
jelmervila: why can't a plugin do what with only optional?11:56
vilaadding something other than features11:56
vilathat *is* optional11:57
spivAdd bugs rather than features, maybe? ;)11:58
jelmervila: it's not really plugins that I have in mind, it's whatever we as bzr devs add in the future11:58
spivI'm very new to this topic, but I'm not sure what sorts of flags you could have in a format that couldn't be sensibly called "features" — parameters maybe?11:59
jelmerspiv: possibly11:59
spiv(Although parameters strike me as something I'd probably prefer to have in a separate file, rather than encouraging anyone from editing format files!)12:00
jelmerspiv: I'm mostly concerned that we if we only have one namespace, we can't ever add anything else12:00
spivHmm.12:00
spivSo if they are one-per-line, I'm not sure there's much to worry about12:01
vilaformat bumps allow adding anything, are you trying to entirely avoid format bumps ?12:01
jelmerspiv: the discussion is (among other things) about whether they should be one line :)12:01
spivBecause "optional non-feature=17" would still be usable backwards and forwards.12:01
jelmervila: yes, I would realy like to avoid another one12:01
spivvila: "entirely" is an extreme goal, but "greatly minimise" sounds like a good (and plausible) goal to me12:02
vilaspiv: precisely my question12:02
spivWell, I'm not sure the distinction matters really?12:03
jelmervila: if we have them in a list, it greatly limits what can be in there12:03
spivBecause we already have the fallback to format bumps if we find no other way, but if we try hard to not have any more we might just achieve that.12:03
vilawell, I see feature flags as a way to *prepare* format bumps12:04
spivvila: I like the way ext2 → ext3 → ext4 has evolved surprisingly smoothly with in-place upgrades12:04
spivvila: and it's in part due to having something quite like feature flags AIUI12:05
vilaformat bumps indeed imply smooth upgrades12:05
jelmerhttp://pastebin.ubuntu.com/778530/12:05
vilabut saying feature flags will allow avoiding format bumps without having experimenting with them...12:05
spivDo you mean “imply we need to add support for smooth upgrades?”12:05
jelmerthat's basically the different options as I see them12:05
vilaspiv: we need to improve the upgrade experience, there is a consensus that we are not there yet12:06
spivBecause that's not what we have now, nor quite how I feel the ext2/3/4 example has worked12:06
jelmeror http://pastebin.ubuntu.com/778531/, with read-optional12:06
spivI'd say that for years now, format bumps have implied very rocky upgrades in practice12:06
spivAnd rather than just saying "well we'll fix that next time", perhaps we should look for a different path entirely12:07
jelmerspiv: (1) is the current format, (2) is what vila is suggesting, (3) and (4) are alternatives that I could also live with12:07
vilaspiv: yup, but the code has evolve a bit since the last bump but some more polish is still needed12:08
jelmerspiv: Yeah, I think ext2/3/4 is indeed a good example of a nicer way of doing this12:08
vilajelmer: you didn't mention required ?12:08
jelmerspiv: (and they don't have the problem of people sending each other disk blocks over the interwebz)12:09
spivWe may need to do something to make the bump to with-feature-flags less rocky than in the past, but my point is that feature-flags is a highly plausible route for much smoother upgrades in future12:09
vilaspiv: we all agree on that12:09
jelmerspiv: enabling feature flags doesn't require a format bump, the only real bump is when you actually enable a feature12:09
jelmervila: yeah, this is mostly an example - I cna add some if you like12:09
vilalunch time here, daughters calling12:09
spivjelmer: my initial preference is for 412:10
vilajelmer: nope, just checking (the first line may vary too)12:10
spivjelmer: if it's flexibility you want, that way has got it:12:10
jelmerhttp://pastebin.ubuntu.com/778535/12:10
spivjelmer: you could e.g. imagine instead of a registry of feature-flag keys, a registry of "can-you-interpret-feature-line" functions12:11
spivjelmer: initially all we might have are one-word keys, and indeed a single function that looks for and understands those12:11
jelmerspiv: yeah, that makes sense12:12
spivjelmer: but it leaves scope for future readers (including the same version of bzrlib with shiny new plugin) to do arbitrary fancy stuff if you really want12:12
vilajelmer: bbl, using examples is far clearer, add garbage in all places where it would be ignored or seen as required and we should get a far better picture12:12
vilaand I'm a big fan of registries too ;)12:12
jelmerspiv: that's indeed the sort of option I would like to keep open12:13
spivjelmer: I'd think probably we don't need to worry about the slight bloat vs. all-one-line, because it'd take quite a few features to have this exceed even 1k12:13
spivThe one-per-line format is also dead-simple to parse (or tokenise ;)12:14
jelmerspiv: yep :)12:15
spivAnd also easier to add new flags to than a comma-separated format, assuming no ordering restrictions: just "echo 'optional new-feature' >> format"12:15
spiv(unless you're on a platform with a non-\n EOL :)12:16
spivHmm, one other comment:12:16
spivI'd actually suggest changing the first line12:16
spivFor the zero-flags case, where it's the same as today, sure keep it the same.12:17
spivBut otherwise a new format would be good as a hint to users with older bzrs trying to google for errors12:17
jelmerspiv: I'm not sure12:18
spivIt'll be slightly inconvenient I'm sure12:18
jelmerspiv: It makes things hard as features are removed again12:19
jelmerspiv: and we'd backport this to older series, so hopefully most people will end up with a version of bzr that understands it12:19
spivBut it will avoid giving confusing errors where the user looks at a big long string that has the first 90% the same as another big long string that works12:19
spivWhich is very much the sort of error that will confuse people, because which users actually read every byte of the format string in that sort of error?12:20
* vila passing around, jelmer: isn't this turning into something a prober should handle ?12:20
spivjelmer: It definitely does suck for the "remove last feature flag from format" case.12:21
spivjelmer: but that's a modest code inconvenience in exchange for confusing unlucky users less12:21
spivThink of it as part of the "making upgrades smooth" goal that we all agree on ;)12:22
spivAnyway, that's just some quick opinions before bedtime.  You're welcome to disagree, I know you've been thinking about this for more than the 10 minutes that I have been!12:23
spivjelmer: parting thought: do you have concrete examples of feature-flags you think we might have?12:24
spivjelmer: the case that springs to mind for me is some of the optional look-aside indices that we've sometimes talked about adding to repos (and in some cases have plugins for, like search or revnocache)12:25
vilaspiv: nested-trees, git-cache, bzr-search-index12:26
spivjelmer: I could imagine e.g. an "optional revision-graph-heads-cache"12:26
jelmerspiv: yep12:27
jelmerspiv: that also seems like something that could be read-optional - i.e. you can access the repository without having it installed, but if you write to it you need to have the feature12:27
spivjelmer: (readers that want to use that cache would need to do something like compare the current pack-names with the pack-names at the time the cache was last regenerated, in case a writer without the flag added revisions)12:27
spivjelmer: or that!  But that's less smooth ;)12:28
spiv(great for safe prototyping though before adding the extra backwards-compat polish)12:28
spivjelmer, vila: it intrigues me that with the possible exception of nested-trees these all seem like primarily flags on the repo component12:29
jelmerspiv: search indexes are on branches12:29
spivAh!  Interesting.12:29
spivAnyway, bedtime over here.12:30
jelmerg'night :)12:30
spivMerry winter solstice and/or other season-appropriate greetings, and good night :)12:30
jelmerhehe, you too !12:32
vilajelmer: back12:58
vilajelmer: so, how about probers ? If they can't handle that, why ?12:59
vilajelmer: and is there a link with all the refactoring you did related to foreign plugins and feature flags ? If not, why ?13:01
jelmervila: back too13:12
jelmervila: what about probers? The bzr prober only checks for the .bzr/branch-format file, it doesn't try to parse it, that's all in Bzr(Dir)Format13:12
jelmervila: feature flags are bzr-specific13:12
vilabut isn't it the part that decide whether or not a format can be opened ?13:13
vila(and already implement a registry with all the associated flexibility)13:13
vilaI realize a lot of ideas are thrown around against an *existing* proposal which is frustrating but I think it's worth it13:14
jelmervila: the prober just returns the format if it can find it13:15
jelmervila: if it can't, it raises UnknownFormatError13:16
jelmerwhether or not the format is supported isn't checked until later13:16
vilaha, ok, and all formats inherit from BzrFormat (with your proposal at least, may be worth splitting :-})13:17
vilaright, there is the check_support_status13:17
vilaand the parsing, sorry, not familiar with this code yet ;)13:18
vilajelmer: and the other question ?13:20
jelmervila: what was the other question (sorry) ?13:20
vila<vila> jelmer: and is there a link with all the refactoring you did related to foreign plugins and feature flags ? If not, why ?13:22
jelmervila: ah13:22
vilahttp://paste.ubuntu.com/778596/ (4) with garbage added13:22
jelmervila: there is no link, because feature flags are specific to bzr formats13:23
jelmervila: that last line would be treated as requiring a feature name "not starting with (optional, read-optional or required) is handled as if a required feature was not present"13:24
jelmervila: (so we can add new necessities in the future, while not breaking old versions of bzr too badly)13:24
vilagood for bzr but not good enough for foreign plugins ?13:24
jelmervila: it's a format-specific feature13:25
jelmervila: we can't write to .svn/format and have svn clients honor that and not break :)13:25
vilaha :)13:25
vilahmm, so better use http://paste.ubuntu.com/778603/ then13:27
jelmervila: no, that would break the ability to add things to the end of the line13:28
jelmervila: what's wrong with the interpretation I mentioned earlier?13:28
vilafeature names should not contain spaces13:29
jelmervila: but what does swapping the name and the necessity help?13:29
vilait makes it clearer what the most important stuff is: the feature name13:29
vilaand matches your implementation, key=name, value=necessity13:30
jelmersigh, I fear we're back where we started :(13:30
jelmervila: that breaks extensibility again13:30
vilawell, you still haven't answered my initial objections...13:30
jelmervila: what were those?13:30
jelmervila: you were reasonably happy with (4) right?13:31
jelmervila: if you don't see us needing the extensibility, what's the problem with interpreting "everything not starting with (optional, read-optional or required) is handled as if a required feature was not present13:31
jelmer"13:31
jelmeras a feature named "not starting with (optional, read-optional or required) is  handled as if a required feature was not present13:31
jelmer"13:32
jelmerwith necessity "everything" (which, because it is unknown, gets treated as required)13:32
vilaI haven't agreed yet on the format, I'm discussing it13:32
jelmerI didn't say you had13:34
vilaha, sorry, misread reasonably happy, let me clarify then13:34
vila(4) seems like a good alternate for (2)13:34
vilaI want to see where garbage is interpreted13:35
vilameh13:35
vilaI want to see where garbage is accepted and how it is interpreted13:35
vilaif you want extensibility at the feature level, it makes sense to start with line format where only two things are required: the feature name and the necessity13:36
jelmervila: I agree13:36
jelmervila: I think the reason I like the necessity first is that it makes the file read like a check list13:37
vilafrom there, since additional stuff is feature specific, it makes sense to make the necessity a feature attribute (which your implementation already does)13:37
jelmervila: and it means it's possible to allow spaces in feature names (and do fancy stuff later)13:37
vilameh bad idea, if you start with spaces you want to allow what more ? unicode ?13:38
jelmervila: allow spaces, not encourage spaces :) It means we can tack on stuff at the end later /if we want to/13:38
vilare-read my paste, it allows more optional stuff after the necessity, making it mandatory will require a backport though13:39
jelmervila: for now, everything after the necessity would be part of the feature name13:40
vilaand anyway we said parameters should not be part of the format or do we disagree on that ?13:40
jelmervila: that way we wouldn't need a backport later13:40
vilahuh ?13:40
jelmervila: yeah, parameters shouldn't be added to the format, at least not now13:40
vilayou won't recognize the feature anymore13:40
jelmervila: right, and that's the point13:41
vilashudder13:41
jelmerbetter to not recognize a feature than to load it with the wrong data13:41
vilawould you mind mention your motives when you know them instead of waiting for me to discover it  by poking randomly? :-D13:42
vilas/it/them/13:42
vilayou can get the same effect with less magic by *changing* the feature name when it needs more stuff13:42
jelmervila: right, I'm just saying there's no particular reason spaces couldn't be part of the name13:43
vilaI have one such reason: identifiers cannot contain spaces :)13:43
jelmervila: who says they'll just be identifiers forever?13:44
vilawhat would be the need ?13:44
vilaon the other hand, enforcing identifiers allows useful stuff like mapping to the file system, mapping to python modules, etc13:45
jelmervila: as I said earlier - I don't know, but I would like to keep the ability to add stuff open13:45
vilaI don't know either but I won't forbid such uses for no good reasons13:45
jelmervila: you mean, you would ? :)13:46
vilayeah :) I don't want to allow things that will make my life harder13:47
vilahandling spaces in identifiers has always make my life harder13:47
jelmervila: again, I'm not saying it would be good practice to allow spaces in feature names13:47
jelmervila: and we're not mapping features to anything, they're just arbitrary strings13:48
jelmervila: s/allow/use/13:49
vilayou're using them in a set() and a dict() already, the later *is* a mapping13:49
jelmervila: not in the sense you meant13:49
vila?13:51
jelmervila: either way, spaces after feature names wouldn't usually happen.. this is just a corner case of what we do in the parser with when we encounter them13:51
vilabut that's the whole point of defining a format13:51
jelmervila: we don't need to map features to python modules, file systems, etc13:51
vilaif it's not defined you can't write a robust parser13:51
jelmervila: so you would just ignore everything after a space?13:51
vilaso you can use split(' ', 2) yes or even split(' ', 1) and delegate to a registry as spiv suggested13:53
jelmervila: if you don't see the use of ever having spaces in the feature data, what's the problem with just including the in the feature name for the moment?13:53
jelmervila: but we're not doing that (delegating to a registry) just yet13:53
jelmervila: when we do, then we'll start splitting and passing the rest of the string (after the space) to the feature13:54
vilathat's still a property of the format we're discussing13:54
jelmervila: but old bzr versions shouldn't try to open a feature while discarding data in the file13:54
vilawho forbids adding new stuff now ?13:54
jelmervila: what do you mean with now?13:55
vilaif old bzr versions should not ignore adding data you can't add it13:56
vilaadded13:56
jelmervila: why not? I'd rather have the old version of bzr not be able to load the feature at all than load it without the extra data13:57
vilayou lost me here13:57
jelmervila: let's say we do add feature parameters in bzr 2.713:58
vilaI've been advocating a robust format (which we don't have yet) for this reason (don't open what you don't understand) and you've been complaining that it will forbid adding more unknown stuff13:58
jelmervila: and bzr-search starts setting "optional search with-authors-data"13:59
vilabzr-search business, since that requires additional data put 'with-authors-data' there and deal with it14:00
jelmervila: we don't want older versions of bzr to open that branch and not see the "with-authors-data" flag when they write to the index - because they wouldn't add the authors data and make the index incomplete14:00
jelmervila: sorry, but I still don't still what's not robust about the current format.14:01
vilait won't be robust until we know what is recognized and what is not and what happens in all cases14:02
vilathere should be no unknown as far as (format + parser) is concerned14:02
jelmerit's pretty well defined what is recognized and what isn't14:02
vilathere are ways to allow some unknown in the format14:02
vilawhere is that defined ?14:02
jelmerok, that's a fair point14:03
jelmerI was going to say.. in the parser :)14:03
vilapfew14:03
jelmerthe spaces handling isn't defined in the docs or the tests, but all the other stuff is14:03
vilaprogress ! :)14:03
vilayes, many things are defined, some better than others but I don't mind that too much,14:04
vilawhat I care about is that there is *no* unknown14:05
vilaand the simplest the format is, the less unknowns we have to care about14:05
jelmervila: again, I think that's true for the current format :)14:06
vilafor current == ?14:06
vilahttp://paste.ubuntu.com/778603/ ?  http://pastebin.ubuntu.com/778535/ (4) ?14:06
jelmervila: "format 4" - basically lp:~jelmer/bzr/feature-flags with " feature " removed14:06
jelmerin short:14:07
vilahaaa14:07
jelmerwe allow additional lines in the format file, each consisting of: a necessity (not containing a space), a space, and a feature name (anything but a newline), and a newline14:07
vilahmm, that was as in: 'ok, let's look at a summary to re-sync'14:07
vilaanything but a newline is too magic to my taste without being the only way to provide something14:09
jelmervila: it's the simplest and allows for the most extensibility in the future14:09
jelmervila: we can disallow registering features with spaces in their name?14:10
vilabetter disallow at the source14:10
vilaallowing stuff and then saying "no, you can't" is frustrating :)14:11
jelmervila: "be liberal in what you accept, conservative in what you send"14:11
vilayup, we generate the format file :)14:11
jelmervila: I don't want us writing feature names with spaces in them, I want us to be able to deal with and not misinterpret format files that we receive14:12
vilabut me too damn it, why do you think I'm discussing ?14:12
jelmerok, perhaps there's some miscommunication here14:13
jelmervila: I think we're agreed that we shouldn't allow spaces in feature names?14:14
jelmervila: the question is what to do with spaces we find in files we receive14:14
vilayes (no spaces)14:14
vilaspaces we receive..14:15
vilafirst,14:15
vilawe have lines14:15
jelmervila: I think we should basically treat anything with a space in it as unknown14:15
vilaas long as we recognize a line, we continue,14:15
vilawhen we encounter a line we don't recognize => as if a required feature was not there14:16
vilaha14:16
vilawhat kind of unknown ?14:16
vilaif all unknowns are considered as an absent required feature, it's easy14:17
jelmervila: the feature flags doc describes this14:17
vilaooooh, are you saying you don't want to allow optional parts after the feature name ? Never ?14:17
jelmervila: if we encounter "optional foo bar" I want to still load the file, because there is an optional feature we don't know about14:18
jelmervila: even if foo is registered14:18
jelmervila: if we encounter "required foo bar" I think we should abort14:19
jelmervila: the first word is always interpreted as the necessity - unknown necessities are considered equal to "required"14:19
vilacould you write tests for that ? I have a gut feeling there is a hole there14:20
jelmervila: there are tests for this14:21
vila<"optional foo bar" I want to still load the file > but it's an unknown14:21
jelmervila: not for the space handling, but for the unknown necessities14:21
jelmerI'll write some for the space handling14:21
vilaisolating the parser and writing direct tests will probably help14:22
vilathe expected output being: can/can't open14:22
jelmerthe parser is literally three lines14:22
jelmerbut I can split it out14:23
vilafrom_string ?14:24
vilagood enough then14:24
vilabut even with 3 lines I think it will choke on 'not-asingle-space-your-split-will-blowup'14:25
jelmervila: I'm using .split(" ", 1)14:26
vilayou changed it since the version I'm looking at then :)14:26
jelmerI've just pushed a version that disallows registering features with spaces in their name14:27
vilajelmer: on the basis that a feature should not use spaces so can't be recognized if more stuff appears after it in the format ?14:31
vilagrr diverged branches14:32
jelmervila: yeah14:32
vilafar simpler :)14:36
vilaand necessity first to be allows to add more in the future (could have worked if it was second too ;)14:38
vilaordereddict requires python-2.714:39
jelmeroh, ok14:41
jelmerI guess it's not the worst thing in the world if we write things back in the wrong order14:41
vilawhen do you write them and from what ? as_string() ? How are they *created* then ?14:42
jelmervila: some other API (probably e.g. Repository.update_features) updates format.features and then writes out format.as_string() to its format file14:43
vilaI may miss something but the only place I see self.features modified is by from_string()14:43
vilaha, but that's not addressed by your proposal right ?14:43
jelmervila: indeed14:44
vilaright. well, that would help the discussion but the format looks simpler now, let me recap:14:45
vilaa line is <necessity<space><feature><newline> if feature is not registered => can't open (msg to the user ? NotABranch and such ?)14:45
vilaif a line doesn't match that => can't open (msg ?)14:46
vilaha no, MissingFeature14:47
vilajelmer: correct ?14:47
jelmervila: if the feature isn't registered (and required) the user indeed gets MissingFeature14:48
jelmeran invalid line (ie one missing a space) causes ValueError at the moment, that should probably be a UnknownFormatError instead14:48
vilahmm, more probably broken, the first line have been recognized14:49
jelmerwell, who knows what extensions we might add in the future :)14:50
vilaFormatCorrupt ?14:50
vilahungh14:50
jelmerhmm, I think corrupt sounds a bit alarming14:50
vilaI want this case to be covered :)14:50
jelmervila: perhaps just leaving it as Valueerror for the moment?14:50
jelmervila: test_from_string tests it14:51
vilaso we can indeed not emit a FormatCorrupt unless the content is indeed broken14:51
vilaWe have DirstateCorrupt for this reason14:51
vilaand LockCorrupt (if you want a case closer to the format file)14:52
vilaI mean covered as in: we open or not and if not because a feature is missing14:52
viladon't add a new unknown again :)14:53
jelmervila: so, I'm not particularly concerned about this either way. I think a ValueError isn't the worst thing in the world for this, but I'd be happy to add FormatCorrupt too14:54
vilaAnd the ValueError is caught ?14:56
vilaOr does it bubble up to the user ?14:56
jelmervila: I'm happy for it to bubble up - we do that in a lot of other cases too, and it provides the best data to report back to us developers14:57
jelmere.g. we have the same when we read the last-revision file14:57
vilameh that's not a good reason14:58
jelmervila: either way, I don't really care what we do in this case14:59
jelmervila: let's focus on the core stuff14:59
vilaI do14:59
vilaThis code will be backported14:59
vila(necessity, feature) = 'foo'.split(' ', 1)  breaks15:00
jelmervila: that only occurs if people somehow have a corrupted format file15:00
vilaexactly15:00
vilawe keep getting bug reports about corrupted files, if we can diagnose them in a 3 lines parser why not do it ?15:01
jelmervila: we don't catch ValueErrors in a lot of other cases either if there are corrupt files15:01
jelmervila: I think adding CorruptFormat will make it harder to debug, not easier15:02
jelmervila: unless I'm missing something?15:03
vilaI've never see a finer error handling render debug harder... the code is fresh, there is an issue, handling it later will cost more (probably less than the time we already spent discussing it)15:03
vilahey wait,15:04
vilainvalid format header is already a ValueError ?15:04
vilaoh, that's what is presented to the user for unknown formats ? Naaaah15:04
jelmervila: no15:04
vilathen it's caught somewhere ?15:04
jelmervila: we already check the first line earlier, because we look that up in a registry15:05
vilaraise ValueError("Invalid format header %r" % format_string)15:05
vilaerr15:05
jelmervila: line 117515:05
vilaraise ValueError("Invalid format header %r" % text) in your proposal15:05
jelmerI guess this could be an AssertionError15:05
vilayes, better than ValueError15:06
vilathe object can't be open anyway15:06
vilaespecially if the line is displayed15:06
vilabut wait15:07
vilawhere is the ValueError caught ?15:07
jelmervila: nowhere15:07
jelmervila: that first line is looked up in the format registry15:07
jelmervila: and if that raises a KeyError, we raise UnknownFormatError15:08
vilaonly later ?15:08
jelmersee line 1171-117515:08
jelmervila: before15:08
vilaI'm there but that's where the exception is raised not caught15:08
jelmervila: where UnknownFormatError is raised you mean?15:09
vila'invalid format header' is informative, 'need more than 1 value to unpack' is not, especially if the line is not displayed15:09
vilano no, ValueError15:09
jelmervila: sorry, 124315:09
vilaKeyError here15:09
vilaoh, I see what you mean15:10
vilaright, probe_transport :)15:10
vilahmm, UnknownFormatError(line, kind='feature-flag') ?15:11
jelmervila: who says the unparseable line is a feature flag?15:12
jelmervila: I think the format as a whole that is unknown is the bzrdir/repository/branch/workingtree format15:12
vilait's where feature flags are defined and should indicate a corruption ? May be FormatCorrupt is better ?15:13
jelmervila: sure15:13
vilaanyway, we agree it's a case where we can't open right ?15:14
jelmeryes15:14
vilaso as long as the message is better than 'need more than 1 value to unpack' with no context...15:15
vilaAssertionError will do15:15
vilaif it's corrupted, the line should give enough hints, if it's not (a mythical unknwon :) it will be clear too15:16
jelmerright15:16
vilathe plan to backport is to call the parser code everywhere it's needed in old bzr right ? (As in: without backporting BzrFormat related changes)15:17
vilahmm, a bit more than the parser, the set() and dict() handling too right ?15:18
jelmervila: depends on how much we want to backport15:18
jelmervila: actually, yeah15:19
jelmervila: at least backporting the parser and calling that everywhere15:19
jelmerand then probably ignoring optional lines and raising MissingFeature for each non-optional feature we encounter15:19
vilathat's check_support_status right ?15:20
jelmervila: yep15:20
jelmeror a simplified version of it15:21
vilanot by much if you want to allow support for required features but may be that could be done separately15:21
vilaor may be we only provide support for optional features which would be ok with me15:22
jelmervila: I'm happy if old bzrs can just skip optional features and print a sane error if they encounter required features15:22
vilayup, which a robust parser should provide15:23
* vila looks if the parser can be made even more robust by deleting one line or two15:24
vila:-p15:24
jelmer:)15:26
vilajelmer: hmm, you haven't included read-optional yet ?15:29
jelmervila: no, that would be too big a change, and there's no particular reason to already include it15:29
vilaIf that requires a backport and then a release and then an install...15:29
vilaI'm lost, what change ?15:30
jelmervila: hooking into lock_write15:30
vilaright15:30
vilabut15:30
vilaoh, to forbid writes15:30
vilaok15:31
jelmervila: pushed use of ParseFormatError15:33
vilahehe lineno+215:39
vilaoooh, and you added format to the previous ValueError too !15:40
jelmervila: s/ValueError/AssertionError/ :)15:41
vilano, I'm referring to the one for invalid header, the format was there already ?15:42
vilaoh no, you turned it into an AssertionError !15:42
jelmeryes15:42
vilalp incremental diff is totally broken15:42
vilaghaa, no, it conflates all the revisions, nm15:44
vilaand splitted tests ! It's Christmas !15:44
vilajelmer: do you want a second review ?15:45
* vila ducks15:45
vilaghaaa, you resubmitted it ? I voted on an old one...15:46
jelmerwhoops15:46
jelmerI resubmitted it because I wanted a new diff, lp was taking too long to update..15:46
jelmervila: and THANKS15:46
vilapfew, thanks for your patience, I hope you don't mind the time spent here but I feel confident that we would have spend far more in backporting and handling spurious bugs otherwise15:48
jelmerthat was probably the longest IRC discussion I have ever had about a single MP, but it seems to've worked :)15:48
vilahehe15:48
vilajelmer: there is no urgency (hmm) but don't forget that we'll need to release whatever you backport so it could take a while before we can safely deploy even optional features15:50
vilait may not matter if we start experimenting with people already using 2.5 but...15:50
vila...the sooner the minimal stuff is backported the sooner we can experiment freely15:51
jelmervila: yeah15:53
=== yofel_ is now known as yofel
smoseris this a known bug ? http://paste.ubuntu.com/778868/17:25
smoseris think i saw poolie mention issues with etc keeper and locale on a list.17:25
smoserthat is a pristine precise install then some automated 'late_command' run after installer.17:27
vilasmoser: yeah, depending who you ask, the bug can be in bzr/python/ubuntu or yourself for not getting the file system encoding right17:28
smoserwell i certainly blame anyone but me.17:28
vilasince the locale is C...17:28
vilasorry, was kidding as there was a heated discussion around a patch proposal for python17:28
smoser:)17:28
smoseri'm joking too.17:28
smoseri understood.17:29
vilathe python guys said: tell your users to set the right locale17:29
smoseri was fairly surprised that apt didn't fail17:29
smoserthat in itself is almost a bug.  something tried to run bzr (etc-keeper i think). i would have thought it would cause install failure.17:29
vilawell, it probably doesn't try to find a valid unicode representation of the path17:29
smoserso what bug would i subscribe to just to follow?17:31
vilathe surprising bit is that several packagers (in a related but less heated discussion) mentioned that utf8_something was the default for ubuntu17:31
vilaha, mgz knows17:31
vilabut he've been pretty quiet today so I'm not sure he's around17:31
vilajustasec17:32
vilaBug #79435317:32
ubot5Launchpad bug 794353 in Bazaar "ascii is a bad default filesystem encoding" [High,Fix released] https://launchpad.net/bugs/79435317:32
vilaha, fix released :) Let's check where17:33
vila2.5b517:33
vilasmoser: <http://bugs.python.org/issue13643> for the attempt at fixing python itself17:35
vilasmoser: in other words, this is in flux but a fix is currently in bzr.dev (2.5b5 will be released  around 2012-01-16)17:37
smoservila, thanks.17:37
smosergood enough for me17:37
mgedminhelp? 'bzr commit' used to show me the diff in the commit message template, but now it stopped20:16
mgedminI'm yak shaving already, can anybody point me to a quick setting I could check?20:16
* mgedmin looks at ~/.bazaar/bazaar.conf and notices [ALIASES] ci = ci --show-diff20:17
mgedminoh, so I used to type 'bzr ci' and now I started typing 'bzr commit', apparently20:17
mgedminI thought I read in a recent message to the mailing list that show-diff was on by default?20:18
jelmerhi mgedmin20:18
jelmermgedmin: I'm pretty sure --show-diff isn't on by default20:18
mgedminhi!20:20

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!