[darcs-users] example of annotate.py alternative output

Sean Perry shaleh at speakeasy.net
Mon Mar 21 01:59:08 UTC 2005


Mark Stosberg wrote:
> On 2005-03-21, Kannan Goundan <cakoose at yahoo.com> wrote:
> 
>>I've attached a Python script that converts Darcs' annotation output
>>into an easier-to-read format.  It basically creates short nicknames
>>for patches and then dumps output similar to SVN blame.  Thought it
>>might be useful for people who want to mess around with the output
>>format before coding it up in Haskell.
> 
> 
> For the impatient or Python deprived, here's some sample output from it.
> 
> First, it lists the patch names, which looks like this:
> 
> -- Patches --
> 
> autrijusa: autrijus at autrijus.org, 20050224213732
>  * import for today.
> 
> perl6-comp: perl6-compiler at perl.org, 20050317154415
>  * syncup
> 
> autrijusa2: autrijus at autrijus.org, 20050207024504
>  * fill in DATE and VERSION from lib/Perl6/Pugs.pm.
> 
> perl6-comp2: perl6-compiler at perl.org, 20050307095016
>  * syncup
> 
> #########
> 
> You can see that the unique patch tokens are somewhat sensible.
> You can guess that a patch is the 'second patch from perl6-compiler at perl.org'
> from the context. The only thing that is sub-optimal is that the date 
> format, which would be easily fixed. 
> 
> Next comes the annotated output:
> 
> -- File Contents --
> 
>   autrijusa3: #!/usr/bin/perl
>               use strict;
> perl6-comp12: use warnings;
>   autrijusa4: use Config;
>   autrijusa3: use inc::Module::Install;
> 
>   autrijusa8: my $pugs = "pugs$Config{_exe}";
> perl6-comp12: my $version_h = "src/pugs_version.h";
>               my $config_h = "src/pugs_config.h";
>               my @srcdirs = ("src", grep(-d, glob "src/*"));
> 
> ############################
> 
> I bet I can guess what's happening here: The lines with patch ideas next
> them to are indicating the last patch to change the line. The lines with
> no token next them have always been there. 
> 
> If I search for 'autrijusa3:', I can quickly find the patch description
> and all of the lines it affected. 
> 
> Very nice! I was never a power-user of this feature in CVS or SVN, but
> this is already /much/ better than what darcs currently provides. 
> 
> If something like this doesn't appear in darcs soon, I think it would be
> worth publishing a link to this tool from the wiki so people can use it
> in the meantime. 
> 
>     Mark
> 

Attached is a patch for a better date format. I used python's strftime 
with a "%x %X" format which means "locale's date" "locale's time", so I 
get 02/28/05 19:57:42 here in the US.
Modify function pretty_date as you see fit.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pretty_date.patch
Url: http://lists.osuosl.org/pipermail/darcs-users/attachments/20050320/0c6c5d51/attachment.diff 


More information about the darcs-users mailing list