cvschangelogbuilder

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

cvschangelogbuilder

Post by code reader »

just noticed that the cvs stats were moved to cvschangelogbuilder. (didnt see an announcement, maybe one will be made later?)

thanks! i especially like the "diff" button. it really helps those who want to poke into the code and see what was actually changed!

not to detract from this very nice improvement, i'd like to make a small request:
when viewing a php source file, it would be nice if highlight_file() or highlight_string() would be used.

Thanks!!!

User avatar
Acyd Burn
Posts: 1838
Joined: Tue Oct 08, 2002 5:18 pm
Location: Behind You
Contact:

Re: cvschangelogbuilder

Post by Acyd Burn »

code reader wrote: just noticed that the cvs stats were moved to cvschangelogbuilder. (didnt see an announcement, maybe one will be made later?)


No, there will be no announcement of course.
when viewing a php source file, it would be nice if highlight_file() or highlight_string() would be used.


Sorry, but you eventually noticed that the diff and source link are all redirecting to sourceforge viewcvs...

Image

code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

Re: cvschangelogbuilder

Post by code reader »

Acyd Burn wrote: Sorry, but you eventually noticed that the diff and source link are all redirecting to sourceforge viewcvs...

the nice thing about highlight_file() is that it can work with remote files as well.
all you need is to have a single php file in your site, say highlight.php that looks approximately so:

Code: Select all

<?php highlight_file($_GET['url']); ?>
and then, in changefilebuilder, you change

Code: Select all

sub FormatCvsFileLink {
	my $url=shift;
	my $version=shift;
    if ($ViewCvsUrl) { 
        my $string='';
        $string="$ViewCvsUrl";
        $string =~ s/__MODULE__/$Module/g;
        $url =~ s/$Module\@//g;
        $string.="$url";
        $string.="?rev=".$version;
    	return "<a href=\"$string\" target=\"_newcvs\">$url</a>";
	}
	else {
	    return "$url";   
	}
}
to something like (sorry, i probably need some brushing on my perl) also, i didnt try it, so "caveat emptor" 8O

Code: Select all

sub FormatCvsFileLink {
	my $url=shift;
	my $version=shift;
    if ($ViewCvsUrl) { 
        my $string='';
        $string="$ViewCvsUrl";
        $string =~ s/__MODULE__/$Module/g;
        $url =~ s/$Module\@//g;
        $string.="$url";
        $string.="?rev=".$version;
// next line is the change. we need to convert urlencode $string, which in perl is called uri_escape. for this we have to add URI::Escape to the uses clause at the head of the file.
    	return "<a href=\"highlight.php?url=" . uri_escape($string) . "\" target=\"_newcvs\">$url</a>";
	}
	else {
	    return "$url";   
	}
}
this will be a small change, but imo, a significant improvement.

one nice side-effect is that now, when viewing a html file in the styles directory, it looks bizzare. with highlight_file it looks straight.

[EDIT:
the required perl module name is URI::Escape, not URL::Escape ]

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: cvschangelogbuilder

Post by naderman »

Or a simple &view=markup is added to the sf.net url.

code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

Re: cvschangelogbuilder

Post by code reader »

naderman wrote: Or a simple &view=markup is added to the sf.net url.
i dont understand.
i tried to add &view=markup to both php and html files, and it did not seem to make any difference. could you please clarify?
thx.

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: cvschangelogbuilder

Post by naderman »


code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

Re: cvschangelogbuilder

Post by code reader »

thanks!
the reason i didnt see it is that the links generated by the tool al look like this:
http://phpbb.cvs.sourceforge.net/phpbb/phpBB2/mcp.php?rev=1.113
this link will be automatically redirected by sf to:
http://phpbb.cvs.sourceforge.net/*checkout*/phpbb/phpBB2/mcp.php?revision=1.113
(note the /*checkout*/ part). these links ignore the view=markup.
you have to remove the /*checkout*/ part for the view=markup to work.

bottom line:
in the FormatCvsFileLink sub, if you change the line:

Code: Select all

        $string.="?rev=".$version;
to

Code: Select all

        $string.="?revision=$version&view=markup";
everyone will be happy.
this is better than using highlight_file() as i originally suggested, because it highlight nicely html files as well.

so, please, could you please do this change?
thanks.

User avatar
Acyd Burn
Posts: 1838
Joined: Tue Oct 08, 2002 5:18 pm
Location: Behind You
Contact:

Re: cvschangelogbuilder

Post by Acyd Burn »

This change seems to be useful, though i do not understand why are you are pressuring this so much - the relevant things i wanted to include is the diff link - the file could have been stayed there without any link at all.

Image

code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

Re: cvschangelogbuilder

Post by code reader »

you are right. as i said in my initial post, i think this is a great improvement.
i also agree that the diff is the important link.
it's just that by implementing naderman's insight with view=markup, you get the best of both worlds: the concise report by cvschangelogbuilder, plus all the goodies viewvc used by sf provides: syntax highlighting, immediate access to the file's revision log (through which you can diff any two revisions), and cvs annotate.

i didnt think i was pressuring, just suggesting a small improvement. if that's how it feels, i guess i should ease of...
:D


[EDIT:
just noticed that you did implement the view=markup. thanks!
i also noticed that when the commit comment is bug #xxxx, you create a link to the bug tracker! wow! that's ingenious!
:D :D :D
]

Yawnster
Registered User
Posts: 342
Joined: Sat Jan 29, 2005 9:18 pm
Location: London, UK
Contact:

Re: cvschangelogbuilder

Post by Yawnster »

Not quite as pretty on the eyes.. And the thing thats annoying is that i cannot see net line change amounts for each commit..

But its still functional, good job guys..

Yawnster

Post Reply