Re: [fossil-users] Confusing highlighting in side-by-side ignore-whitespace diff
2014-04-03 3:53 GMT+02:00 Andy Bradford amb-fos...@bradfords.org: It looks like a bug to me. For example, line 45 seems to correctly show the purple #define on the left being replaced with a purple space on the right. But the tail end shows a red G at the end of the macro being replaced with nothing on the right but doesn't do anything with the characters following the G to the end of the line. Yes, this is definitely a bug, and from your example I can see what's the problem. I will try to have a look at it today. The reason is that specifying w the calculation of the hash-value of the line changed, and apparently the highlighting algorithm makes an assumption on it which is no longer trunk. Thanks! Jan Nijtmans ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Confusing highlighting in side-by-side ignore-whitespace diff
2014-04-03 8:56 GMT+02:00 Jan Nijtmans jan.nijtm...@gmail.com: Yes, this is definitely a bug, and from your example I can see what's the problem. Fixed here: www.fossil-scm.org/index.html/info/c23190a61d Thanks! Jan Nijtmans ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] TH1: support for octal and hexadecimal numbers in expressions
Hi I have a small patch (it is attached just for reference) to make TH1 use the integers also in other formats (hexadecimal and octal forms). For example, we would use the same expressions then % expr {010+10+0x10} 34 Could we add such a support in Fossil TH1? I believe the TH1 stands for Test Harness 1 and I use TH1 core with the extensions in my embedded projects and it is pity that I cannot just type 0x... :-) Could anyone take a look on the workaround, please? Well, Th_ToInt() become itself a bit more slow, but I think it is still more fast than strtoll(). At the least, I can say that the patch does not break the existing Fossil TH1 tests. Thanks for Fossil! SergeiIndex: src/th.c == --- src/th.c +++ src/th.c @@ -1867,10 +1867,12 @@ {|, OP_BITWISE_OR,10, ARG_INTEGER}, {0,0,0,0} }; +int th_ishexdig(char c); + /* ** The first part of the string (zInput,nInput) contains a number. ** Set *pnVarname to the number of bytes in the numeric string. */ static int thNextNumber( @@ -1877,15 +1879,20 @@ Th_Interp *interp, const char *zInput, int nInput, int *pnLiteral ){ - int i; + int i = 0; int seenDot = 0; - for(i=0; inInput; i++){ + int (*isdigit)(char) = th_isdigit; + if( nInput2 zInput[0]=='0' (zInput[1]=='x' || zInput[1]=='X') ){ +i=2; +isdigit = th_ishexdig; + } + for(; inInput; i++){ char c = zInput[i]; -if( (seenDot || c!='.') !th_isdigit(c) ) break; +if( (seenDot || c!='.') !isdigit(c) ) break; if( c=='.' ) seenDot = 1; } *pnLiteral = i; return TH_OK; } @@ -2411,11 +2418,12 @@ ** '\f' 0x0C ** '\r' 0x0D ** ** Whitespace characters have the 0x01 flag set. Decimal digits have the ** 0x2 flag set. Single byte printable characters have the 0x4 flag set. -** Alphabet characters have the 0x8 bit set. +** Alphabet characters have the 0x8 bit set. Hexadecimal digits have the +** 0x20 flag set. Octal digits have the 0x40 flag set. ** ** The special list characters have the 0x10 flag set ** **{ } [ ] \ ; ' ** @@ -2424,14 +2432,14 @@ */ static unsigned char aCharProp[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, /* 0x0. */ 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x1. */ 5, 4, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x2. */ - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 20, 4, 4, 4, 4, /* 0x3. */ - 4, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x4. */ +102,102,102,102,102,102,102,102,102,102, 4, 20, 4, 4, 4, 4, /* 0x3. */ + 4, 44, 44, 44, 44, 44, 44, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x4. */ 12, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 20, 20, 20, 4, 4, /* 0x5. */ - 4, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x6. */ + 4, 44, 44, 44, 44, 44, 44, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x6. */ 12, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 20, 4, 20, 4, 4, /* 0x7. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x8. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x9. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xA. */ @@ -2455,10 +2463,16 @@ return (aCharProp[(unsigned char)c] 0x11); } int th_isalnum(char c){ return (aCharProp[(unsigned char)c] 0x0A); } +int th_ishexdig(char c){ + return (aCharProp[(unsigned char)c] 0x20); +} +int th_isoctdig(char c){ + return (aCharProp[(unsigned char)c] 0x40); +} #ifndef LONGDOUBLE_TYPE # define LONGDOUBLE_TYPE long double #endif @@ -2571,24 +2585,43 @@ ** interpreter result too. */ int Th_ToInt(Th_Interp *interp, const char *z, int n, int *piOut){ int i = 0; int iOut = 0; + int base = 10; + int (*isdigit)(char) = th_isdigit; if( n0 ){ n = th_strlen(z); } if( n0 (z[0]=='-' || z[0]=='+') ){ i = 1; } + if( n2 z[i]=='0' (z[i+1]=='x' || z[i+1]=='X') ){ +i += 2; +base = 16; +isdigit = th_ishexdig; + }else if( n1 z[i]=='0' ){ +i += 1; +base = 8; +isdigit = th_isoctdig; + } for(; in; i++){ -if( !th_isdigit(z[i]) ){ +int shift; +if( !isdigit(z[i]) ){ Th_ErrorMessage(interp, expected integer, got: \, z, n); return TH_ERROR; } -iOut = iOut * 10 + (z[i] - 48); +if( z[i]='a' ){ + shift = 87; +}else if( z[i]='A' ){ + shift = 55; +}else{ + shift = 48; +} +iOut = iOut * base + (z[i] - shift); } if( n0 z[0]=='-' ){ iOut *= -1; } ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Confusing highlighting in side-by-side ignore-whitespace diff
2014-04-03 9:06 GMT+02:00 Jan Nijtmans jan.nijtm...@gmail.com: 2014-04-03 8:56 GMT+02:00 Jan Nijtmans jan.nijtm...@gmail.com: Yes, this is definitely a bug, and from your example I can see what's the problem. Fixed here: www.fossil-scm.org/index.html/info/c23190a61d The effect of this fix can be seen on fossil-scm.org now, as Richard put the latest fossil binary there. The diff looks as expteded now: http://www.fossil-scm.org/index.html/fdiff?v1=ff3ce7fdb65c5501v2=f897c6fc3888f9easbs=1w Since there are no white-space-only changes in this diff, the w option should have no effect at all. The Ignore Whitespace button should only have effect when the diff contains white-space-only changes, e.g.: http://www.fossil-scm.org/index.html/fdiff?v1=624bb79c74v2=976db410b0sbs=1 Thanks, Richard! Waiting for a new fossil on the Tcl/Tk repositories now;-) Regards, Jan Nijtmans ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] TH1: support for octal and hexadecimal numbers in expressions
2014-04-03 14:05 GMT+02:00 Sergei Gavrikov sergei.gavri...@gmail.com: Could anyone take a look on the workaround, please? Well, Th_ToInt() become itself a bit more slow, but I think it is still more fast than strtoll(). At the least, I can say that the patch does not break the existing Fossil TH1 tests. I'm not fond of allowing a 0-prefix for octal numbers, better restrict it to 0o, which is more consistent with 0x for hex. Yes, Tcl 8.x allows it now, but in future Tcl versions it will most likely being abandoned. See: http://www.tcl.tk/cgi-bin/tct/tip/114 Other than that, it looks good to me. Regards, Jan Nijtmans ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] Fwd: RCS import
Hi, all, i'd like to welcome Andy Goth to the development team, known as user andy (i got an off-list OK from andybradford regarding the user name). @AndyG: i'll send you your temporary password momentarily. -- Forwarded message -- From: Stephan Beal sgb...@googlemail.com Date: Wed, Apr 2, 2014 at 9:25 PM Subject: Re: [fossil-users] RCS import To: Fossil SCM user's discussion fossil-users@lists.fossil-scm.org On Wed, Apr 2, 2014 at 9:22 PM, Andy Goth andrew.m.g...@gmail.com wrote: reveals we already have an andybradford but also many first-name-only users such as bob and eric and erik. So andy should be okay. i'll give Andy Bradford a while to veto that or not before setting you up, just to avoid any potential future confusion. It's almost bed time here, but i'll check back tomorrow evening (CET) and set you up as andy or whatever other name has come to this thread by then. Welcome aboard! -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do. -- Bigby Wolf -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do. -- Bigby Wolf ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] TH1: support for octal and hexadecimal numbers in expressions
On Thu, 3 Apr 2014, Jan Nijtmans wrote: 2014-04-03 14:05 GMT+02:00 Sergei Gavrikov sergei.gavri...@gmail.com: Could anyone take a look on the workaround, please? Well, Th_ToInt() become itself a bit more slow, but I think it is still more fast than strtoll(). At the least, I can say that the patch does not break the existing Fossil TH1 tests. I'm not fond of allowing a 0-prefix for octal numbers, better restrict it to 0o, which is more consistent with 0x for hex. Yes, Tcl 8.x allows it now, but in future Tcl versions it will most likely being abandoned. See: http://www.tcl.tk/cgi-bin/tct/tip/114 Good point. Thak you. With new patch TH1 works as Tcl 8.5 % expr {0o10+10+0x10} 34 % expr {0O10+10+0X10} 34 % expr {0o77+99+0xff} 417 Other than that, it looks good to me. Thanks you for review! SergeiIndex: src/th.c == --- src/th.c +++ src/th.c @@ -1867,10 +1867,13 @@ {|, OP_BITWISE_OR,10, ARG_INTEGER}, {0,0,0,0} }; +int th_ishexdig(char c); /* 0x* and 0X* */ +int th_isoctdig(char c); /* 0o* and 0O* */ + /* ** The first part of the string (zInput,nInput) contains a number. ** Set *pnVarname to the number of bytes in the numeric string. */ static int thNextNumber( @@ -1877,15 +1880,26 @@ Th_Interp *interp, const char *zInput, int nInput, int *pnLiteral ){ - int i; + int i = 0; int seenDot = 0; - for(i=0; inInput; i++){ + int (*isdigit)(char) = th_isdigit; + if( nInput2 ){ +if( zInput[0]=='0' (zInput[1]=='x' || zInput[1]=='X') ){ + i=2; + isdigit = th_ishexdig; +} +if( zInput[0]=='0' (zInput[1]=='o' || zInput[1]=='O') ){ + i=2; + isdigit = th_isoctdig; +} + } + for(; inInput; i++){ char c = zInput[i]; -if( (seenDot || c!='.') !th_isdigit(c) ) break; +if( (seenDot || c!='.') !isdigit(c) ) break; if( c=='.' ) seenDot = 1; } *pnLiteral = i; return TH_OK; } @@ -2411,11 +2425,12 @@ ** '\f' 0x0C ** '\r' 0x0D ** ** Whitespace characters have the 0x01 flag set. Decimal digits have the ** 0x2 flag set. Single byte printable characters have the 0x4 flag set. -** Alphabet characters have the 0x8 bit set. +** Alphabet characters have the 0x8 bit set. Hexadecimal digits have the +** 0x20 flag set. Octal digits have the 0x40 flag set. ** ** The special list characters have the 0x10 flag set ** **{ } [ ] \ ; ' ** @@ -2424,14 +2439,14 @@ */ static unsigned char aCharProp[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, /* 0x0. */ 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x1. */ 5, 4, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x2. */ - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 20, 4, 4, 4, 4, /* 0x3. */ - 4, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x4. */ +102,102,102,102,102,102,102,102,102,102, 4, 20, 4, 4, 4, 4, /* 0x3. */ + 4, 44, 44, 44, 44, 44, 44, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x4. */ 12, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 20, 20, 20, 4, 4, /* 0x5. */ - 4, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x6. */ + 4, 44, 44, 44, 44, 44, 44, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x6. */ 12, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 20, 4, 20, 4, 4, /* 0x7. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x8. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x9. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xA. */ @@ -2455,10 +2470,16 @@ return (aCharProp[(unsigned char)c] 0x11); } int th_isalnum(char c){ return (aCharProp[(unsigned char)c] 0x0A); } +int th_ishexdig(char c){ + return (aCharProp[(unsigned char)c] 0x20); +} +int th_isoctdig(char c){ + return (aCharProp[(unsigned char)c] 0x40); +} #ifndef LONGDOUBLE_TYPE # define LONGDOUBLE_TYPE long double #endif @@ -2571,24 +2592,46 @@ ** interpreter result too. */ int Th_ToInt(Th_Interp *interp, const char *z, int n, int *piOut){ int i = 0; int iOut = 0; + int base = 10; + int (*isdigit)(char) = th_isdigit; if( n0 ){ n = th_strlen(z); } if( n0 (z[0]=='-' || z[0]=='+') ){ i = 1; + } + if( n2 ){ +if( z[i]=='0' (z[i+1]=='x' || z[i+1]=='X') ){ + i += 2; + base = 16; + isdigit = th_ishexdig; +} +if( z[i]=='0' (z[i+1]=='o' || z[i+1]=='O') ){ + i += 2; + base = 8; + isdigit = th_isoctdig; +} } for(; in; i++){ -if( !th_isdigit(z[i]) ){ +int shift; +if( !isdigit(z[i]) ){ Th_ErrorMessage(interp, expected integer, got: \, z, n); return TH_ERROR; } -iOut = iOut * 10 + (z[i] - 48); +if( z[i]='a' ){ + shift = 87; +}else if( z[i]='A' ){ + shift = 55; +}else{ + shift = 48; +} +iOut =
Re: [fossil-users] TH1: support for octal and hexadecimal numbers in expressions
On Thu, Apr 3, 2014 at 3:10 PM, Sergei Gavrikov sergei.gavri...@gmail.comwrote: On Thu, 3 Apr 2014, Jan Nijtmans wrote:Good point. Thak you. With new patch TH1 works as Tcl 8.5 % expr {0o10+10+0x10} 34 % expr {0O10+10+0X10} 34 % expr {0o77+99+0xff} 417 Weird - i've never seen octals written that way, but i trust Jan's judgement implicitly regarding issued of TCL-ness. i'll get that patch added to the standalone th1 library in the next day or two. If you'd like access to that one, contact me off-list and i'll set you up (it's independent of the fossil tree, requires no license waiver, and this would be at least the second fix from you). Thanks, Sergei! -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do. -- Bigby Wolf ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Suggestions for annotate/blame UI
On Thu, Apr 3, 2014 at 3:37 AM, Andy Goth andrew.m.g...@gmail.com wrote: 1. With the potentially wider screen offered by a web browser, I don't see a reason why the user and line number can't both be displayed. Can annotate and blame be combined somehow? Perhaps offer magic JavaScript checkboxes to show/hide the various columns (commit, date, time [not currently shown], line number, user), and the default values of the checkboxes will depend on whether annotate or blame was clicked. The toggling of the user is actually not a bad idea, IMO. The _only_ think i don't like about it is that at some point (when Jan stops tinkering with the ignore-ws bits ;) i will blatantly steal (er... port) that into libfossil and i will need the ability to toggle that generation at the library-level (for clients who don't do JS). But that's my own problem, not fossil's. 2. The color palette is fairly limited, making it hard to visually distinguish between nearby commits. I'd like to see a broader palette, for instance using HSV rather than RGB interpolation. Interestingly enough, this topic came up in a different form a few weeks ago. The explanation was that it's just intended to provide an overview, and not necessarily distinguish closely-timed commits. 3. Colors are all set via span style='background-color:#abcdef;'. This bloats the HTML and prevents my next suggestion. Instead emit some CSS in the head to predefine the various span classes. It's possible to edit the CSS (or HEAD block, for that matter) via the WWW UI. The reason the colors are embedded is because they're generated by a routine which is given a starting color, and ending color, and then it calculates an RGB value somewhere between that: http://fossil-scm.org/index.html/artifact/d9e9227f13aeb17b604b3c9daf81f7752480b5dd?ln=2190-2205 we cannot replace that with CSS unless we predefine ALL colors with CSS names. 4. While any such spans are moused over, change the span's CSS so that all instances of that span are somehow marked, e.g. with a special highlight color like yellow. This should further help to distinguish between versions and see which lines were changed by the same commit. There is certainly more which could be done with hoverhelp, e.g. adding the checkin comment as hoverhelp for the user name or line number. 6. Syntax highlighting. Just kidding, I actually don't want this, but I'm sure somebody will ask someday. It _can_ be done without too much work with JS-side addons. i do something similar in this fossil-based Wiki which saves its pages in Google Code wiki format, serves them over the Fossil JSON API, and renders them on the client. The source blocks of this page, for example: http://fossil.wanderinghorse.net/wikis/cson/?page=TipsAndTricks -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do. -- Bigby Wolf ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] TH1: support for octal and hexadecimal numbers in expressions
2014-04-03 15:14 GMT+02:00 Stephan Beal sgb...@googlemail.com: Weird - i've never seen octals written that way, but i trust Jan's judgement implicitly regarding issued of TCL-ness. See: http://en.wikipedia.org/wiki/Octal Newer languages have been abandoning the prefix 0, as decimal numbers are often represented with leading zeroes. The prefix q was introduced to avoid the prefix o being mistaken for a zero, while the prefix 0o was introduced to avoid starting a numerical literal with an alphabetic character (like o or q), since these might cause the literal to be confused with a variable name. The prefix 0o also follows the model set by the prefix 0x used for hexadecimal literals in the C language; it is supported by Haskell,[10] OCaml,[11] Perl 6, [12] Python as of version 3.0,[13] Ruby,[14] Tcl as of version 9,[15] and it is intended to be supported by ECMAScript 6[16] (the prefix 0 has been discouraged in ECMAScript 3 and dropped in ECMAScript 5[17]). Actually, Tcl 8.5 was the first Tcl version which understands the 0o prefix, but since Tcl 8.4 is still in use somewhere availability is not guaranteed in all Tcl environments. That's my explanation why it isn't used very much. Regards, Jan Nijtmans ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] [fossil all extras] useless without --showfile
On 4/2/2014 11:42 PM, Joe Mistachkin wrote: Andy Goth wrote: I'm curious how a script could make use of [fossil extras] without the benefit of the --showfile option. The --showfile option is processed by the [fossil all] command, not the [fossil extras] command, which basically explains the underlying issue... The [fossil extras] command itself has never printed the associated repository information, while the [fossil changes] command has. Most of that is clear from behavioral observation, but my question still stands. I ask the question in reference to your statement: On 4/2/2014 7:47 PM, Joe Mistachkin wrote: however, given the implementation of the [fossil extras] command itself, it would be difficult to make the changes you are suggesting without breaking backwards compatibility with existing scripts that may wrap Fossil. Backwards compatibility is a worthy goal, but I'm not sure how valuable it is to maintain compatibility with something that could never have worked in the first place and therefore may not even exist. Now, an interesting detail. [fossil changes] has a --header option which implements the Changes for REPOS at DIRECTORY: headers, but [fossil extras] does not have anything of the sort. I see no harm in adding it to [fossil extras]. The compatibility problem only arises when changing [fossil all] to supply [fossil extras] with this new --header option, thereby changing its output format. A possible compromise is to have [fossil all] only give --header to [fossil extras] when [fossil all] was not given --showfile. I suggest this on the presumption that any existing scripts that actually use [fossil all extras] must use --showfile, because the output is otherwise useless except for the limited purpose of saying whether or not there exist any extra files, though not where exactly they are. -- Andy Goth | andrew.m.goth/at/gmail/dot/com ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Confusing highlighting in side-by-side ignore-whitespace diff
Thus said Jan Nijtmans on Thu, 03 Apr 2014 09:06:30 +0200: Fixed here: www.fossil-scm.org/index.html/info/c23190a61d Looks good! Thanks, Andy -- TAI64 timestamp: 4000533d73db ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] TH1: support for octal and hexadecimal numbers in expressions
2014-04-03 15:10 GMT+02:00 Sergei Gavrikov sergei.gavri...@gmail.com: Good point. Thak you. With new patch TH1 works as Tcl 8.5 While on it, I added binary as well. http://www.fossil-scm.org/index.html/info/1f6734c30b Thanks! Regards, Jan Nijtmans ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] TH1: support for octal and hexadecimal numbers in expressions
On Thu, 3 Apr 2014, Jan Nijtmans wrote: 2014-04-03 15:10 GMT+02:00 Sergei Gavrikov sergei.gavri...@gmail.com: Good point. Thak you. With new patch TH1 works as Tcl 8.5 While on it, I added binary as well. http://www.fossil-scm.org/index.html/info/1f6734c30b Thanks! Sure, '0b' also will be helpful for folk who need to move the bits. However, TH does trig on such typos expr 0+0b2 expr 0+0o8 So, for the new three things I would enter three new bit sets for aCharProp[]. Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] libfossil minor milestone: diff app
On Tue, Apr 1, 2014 at 7:25 PM, Stephan Beal sgb...@googlemail.com wrote: KNOWN BUGS: 1) this app cannot currently diff against the checkout version. All the pieces are in place, it just needs to be done. It can now: [stephan@host:~/cvs/fossil/libfossil]$ f-vdiff current . | head DIFF: 75699d4c == local f-apps/f-vdiff.c @@ -21,6 +21,7 @@ */ #include fossil-scm/fossil-cli.h /* Fossil App mini-framework */ +#include fossil-scm/fossil-internal.h /* Need for our use of a couple (currently) internal APIs */ static void fcli_local_help(){ printf(Usage:\n\t%s [options]version1 version2\n\n, fcli.appName); @@ -60,14 +61,174 @@ it uses the value '.' to mean 'current local changes based on the checked out version,' so this is also valid: f-vdiff --from=. --to=current that just reverses the diffs (same as the --invert flag) :) -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do. -- Bigby Wolf ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Very short UUID abbreviations
On 4/3/2014 12:46 AM, Andy Bradford wrote: Thus said Andy Goth on Wed, 02 Apr 2014 21:37:35 -0500: When the UUID is abbreviated to one or two characters, the ambiguous artifact page is bypassed, and it always seems to link to a ticket. It appears that if you happen to have a ticket UUID/SHA1 that just happens to match the beginning part of another artifact, the ticket will always win out. It's hard to test this because it needs a collision of at least length 4 between a ticket and a checkin. Ask and ye shall receive: http://www.fossil-scm.org/index.html/info/6b8e http://www.fossil-scm.org/index.html/info/6b8e09987a847440a2ebf772e4ddcb62c447306a http://www.fossil-scm.org/index.html/info/6b8e355d943a34507eea564ff7ecdcb2a0075d11 http://www.fossil-scm.org/index.html/info/6b8e82544dfc4e88297c8808b11712f1f334039e http://www.fossil-scm.org/index.html/info/6b8ef6a4fd5610f5f0cc648c59511d6e3b78620c http://www.fossil-scm.org/index.html/info/6b8ee7d40d5d7430e4ba816c888a73ba92f3eb2e And another test set which includes two tickets: http://www.fossil-scm.org/index.html/info/2898 http://www.fossil-scm.org/index.html/info/28987096acb2fd6a88b9869ec9f07477b1af6ce0 http://www.fossil-scm.org/index.html/info/289844a2cb535a465c4d956f9907e5b3762d2193 http://www.fossil-scm.org/index.html/info/289890d62b25566652f985cf5ca6bc87ffe69598 Here's a sample query for finding such collisions: SELECT * FROM (SELECT uuid, 'blob' FROM blob UNION ALL SELECT tkt_uuid, 'ticket' FROM ticket) WHERE substr(uuid, 1, 4) = (SELECT substr(uuid, 1, 4) AS prefix FROM blob WHERE prefix in (SELECT substr(tkt_uuid, 1, 4) FROM ticket) GROUP BY prefix HAVING count(*) 1 ORDER BY count(*) DESC LIMIT 1); -- Andy Goth | andrew.m.goth/at/gmail/dot/com ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] [fossil all extras] useless without --showfile
Andy Goth wrote: A possible compromise is to have [fossil all] only give --header to [fossil extras] when [fossil all] was not given --showfile. I suggest this on the presumption that any existing scripts that actually use [fossil all extras] must use --showfile, because the output is otherwise useless except for the limited purpose of saying whether or not there exist any extra files, though not where exactly they are. Excellent idea. Done here: https://www.fossil-scm.org/index.html/info/69974aaa19c7 Thanks. -- Joe Mistachkin ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] TH1: support for octal and hexadecimal numbers in expressions
On Thu, 3 Apr 2014, Sergei Gavrikov wrote: TH does trig on such typos expr 0+0b2 expr 0+0o8 I mean % fossil test-th-eval 'expr 0+0b2' fossil: ../src/th.c:2140: exprMakeTree: Assertion `!apToken[jj] || !apToken[0]' failed. Aborted So, for the new three things I would enter three new bit sets for aCharProp[]. Jan, excuse me that was mistaken guess on the bit sets, the reason was my miss in src/th.c:thNexNumber(). The fix is attached. Thank you. SergeiIndex: src/th.c == --- src/th.c +++ src/th.c @@ -1879,31 +1879,35 @@ int nInput, int *pnLiteral ){ int i = 0; int seenDot = 0; + int seenPfx = 0; int (*isdigit)(char) = th_isdigit; if( nInput2 ){ if( zInput[0]=='0' (zInput[1]=='x' || zInput[1]=='X') ){ i=2; + seenPfx = 1; isdigit = th_ishexdig; } if( zInput[0]=='0' (zInput[1]=='o' || zInput[1]=='O') ){ i=2; + seenPfx = 1; isdigit = th_isoctdig; } if( zInput[0]=='0' (zInput[1]=='b' || zInput[1]=='B') ){ i=2; + seenPfx = 1; isdigit = th_isbindig; } } for(; inInput; i++){ char c = zInput[i]; if( (seenDot || c!='.') !isdigit(c) ) break; if( c=='.' ) seenDot = 1; } - *pnLiteral = i; + *pnLiteral = i - (seenPfx ? 2 : 0); return TH_OK; } /* ** Free an expression tree. ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] TH1: support for octal and hexadecimal numbers in expressions
On Thu, 3 Apr 2014, Sergei Gavrikov wrote: The fix is attached. ^^^ Please, forget it! Sorry. Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] TH1: support for octal and hexadecimal numbers in expressions
On Thu, Apr 3, 2014 at 10:34 AM, Jan Nijtmans jan.nijtm...@gmail.comwrote: See: http://en.wikipedia.org/wiki/Octal Newer languages have been abandoning the prefix 0, as decimal numbers are often represented with leading zeroes. The prefix q was introduced to avoid the prefix o being mistaken for a zero, while the prefix 0o was introduced to avoid starting a numerical literal with an alphabetic character (like o or q), since these might cause the literal to be confused with a variable name. The prefix 0o also follows the model set by the prefix 0x used for hexadecimal literals in the C language; it is supported by Haskell,[10] OCaml,[11] Perl 6, [12] Python as of version 3.0,[13] Ruby,[14] Tcl as of version 9,[15] and it is intended to be supported by ECMAScript 6[16] (the prefix 0 has been discouraged in ECMAScript 3 and dropped in ECMAScript 5[17]). Interesting. Never heard of this trend, but 90% of my coding for work is in C/C++ as I develop SW for controlling electro-mechanical systems. I use 0x (for hexadecimal) and 0b (for binary), but almost never use any octal notation, as nearly all the integer values I work with are 8, 16 or 32 bits in length. (Occasionally, 24 bits) ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users