Wed Jan  9 20:02:18 EST 2008  Mark Stosberg <[EMAIL PROTECTED]>
  * fix potentially troublesome 'rm -rf temp*' commands in test scripts, which 
could have deleted more than intended.

Wed Jan  9 21:30:44 EST 2008  Mark Stosberg <[EMAIL PROTECTED]>
  * clean up test script header...no functional changes.

Wed Jan  9 22:04:00 EST 2008  Mark Stosberg <[EMAIL PROTECTED]>
  * issue31, issue187: Update date matching so we test for an actual match in 
some cases, not just date parsing.
  This revealed some bugs which have yet to be fixed, so the test is still 
failing. 

Wed Jan  9 22:09:55 EST 2008  Mark Stosberg <[EMAIL PROTECTED]>
  * more test script clean-ups, modernization
New patches:

[fix potentially troublesome 'rm -rf temp*' commands in test scripts, which could have deleted more than intended.
Mark Stosberg <[EMAIL PROTECTED]>**20080110010218] {
hunk ./tests/invalid_pending_after_mv_to_self.sh 32
-rm -rf temp*
+rm -rf temp
hunk ./tests/no_pristine.sh 38
-rm -rf temp*
+rm -rf temp1
hunk ./tests/pending.sh 47
-rm -rf temp*
+rm -rf temp temp0
hunk ./tests/pull_binary.sh 33
-rm -rf temp*
+rm -rf temp1 temp2
hunk ./tests/push.sh 27
-rm -rf temp*
+rm -rf temp temp_0
}

[clean up test script header...no functional changes.
Mark Stosberg <[EMAIL PROTECTED]>**20080110023044] {
hunk ./tests/match.pl 5
-use lib qw(lib/perl);
-
-use Test::More qw/no_plan/;
-
+use lib 'lib/perl';
+use Test::More 'no_plan';
hunk ./tests/match.pl 9
-
hunk ./tests/match.pl 10
+use warnings;
hunk ./tests/match.pl 19
-darcs qw( add bar );
-darcs qw( record -a -m "" bar -A x );
+darcs 'add bar';
+darcs 'record -a -m "" bar -A tester';
}

[issue31, issue187: Update date matching so we test for an actual match in some cases, not just date parsing.
Mark Stosberg <[EMAIL PROTECTED]>**20080110030400
 This revealed some bugs which have yet to be fixed, so the test is still failing. 
] {
hunk ./tests/match.pl 22
-sub try_date {
-  my $d = shift;
-  # just be happy if it doesn't complain about the date being fancy
-  unlike( darcs("changes --match='date $d'"), qr(fancy), "match on $d" );
-}
hunk ./tests/match.pl 23
-# FIXME: for now we only check for recognition, not for a correct parse!
+# parse_date just checks for parsing, while match_date checks for an actual match.
+# It's better if we can use "match_date", but we have to be able to construct such a date
+# based on a date dynamically generated by this test script. 
+
+my $raw_date = get_first_date_from_changes();
+my ($mon,$mm,$dd,$year,$hhmmss,$tz) = deconstruct_date( $raw_date );
+
+# use Data::Dumper;
+# warn Dumper  ($raw_date, $mon,$mm,$dd,$year,$hhmmss,$tz );
+
+# predeclare some subs so we can use them without parens.
+sub match_date;
+sub parse_date;
hunk ./tests/match.pl 45
-try_date '2007-01-01';
-try_date '20070101';
-try_date '2007-01';
-try_date '200701';
-try_date '2007';
+match_date "$year-$mm-$dd";
+match_date "$year$mm$dd";
+match_date "$year-$mm";
+match_date "$year$mm";
+match_date "$year";
+
hunk ./tests/match.pl 52
-try_date '2007-W01-1';
-try_date '2007W011';
-try_date '2007-W01';
+parse_date '2007-W01-1';
+parse_date '2007W011';
+parse_date '2007-W01';
hunk ./tests/match.pl 56
-try_date '2007-001'; # first day of 2005
-try_date '2007001';
+parse_date '2007-001'; # first day of 2005
+parse_date '2007001';
hunk ./tests/match.pl 60
-try_date '1992-10-14 24:00';
-try_date '1992-10-15 00:00';
+parse_date '1992-10-14 24:00';
+parse_date '1992-10-15 00:00';
hunk ./tests/match.pl 64
-try_date '1992-02-12T22:32:11';
-try_date '1992-02-12 22:32:11';
-try_date '1992-02-12T223211.0000';
+parse_date '1992-02-12T22:32:11';
+parse_date '1992-02-12 22:32:11';
+parse_date '1992-02-12T223211.0000';
hunk ./tests/match.pl 69
-try_date 'today';
-try_date 'yesterday';
-try_date 'day before yesterday';
-try_date 'last week';
-try_date 'last month';
+match_date 'today';
+parse_date 'yesterday';
+parse_date 'day before yesterday';
+parse_date 'last week';
+parse_date 'last month';
hunk ./tests/match.pl 76
-try_date 'yesterday at 14:00:00';
-try_date 'last 3 years';
-try_date '2 days ago';
-try_date 'last month 13:00' ;
-try_date '15 minutes after 1992-10-02';
-try_date '3 days before last week';
+parse_date 'yesterday at 14:00:00';
+parse_date 'last 3 years';
+parse_date '2 days ago';
+parse_date 'last month 13:00' ;
+parse_date '15 minutes after 1992-10-02';
+parse_date '3 days before last week';
hunk ./tests/match.pl 84
-try_date 'between last fortnight and yesterday';
-try_date 'in the last 45 seconds';
-try_date 'after 1992';
+parse_date 'between last fortnight and yesterday';
+parse_date 'in the last 45 seconds';
+parse_date 'after 1992';
hunk ./tests/match.pl 89
-try_date '1992-10-15 00:00Z/1992-10-15 00:01Z';
-try_date 'P3YT3M/1992';
-try_date '1992/P3Y3M4DT5H3M2S';
-try_date '1992/P3Y3M';
+parse_date '1992-10-15 00:00Z/1992-10-15 00:01Z';
+parse_date 'P3YT3M/1992';
+parse_date '1992/P3Y3M4DT5H3M2S';
+parse_date '1992/P3Y3M';
hunk ./tests/match.pl 95
-try_date 'between 2004-03-12 and last week';
-try_date 'last week';
-try_date 'yesterday';
-try_date 'today 14:00';
-try_date '3 days before last year at 17:00';
-try_date 'Sat Jun  30 11:31:30 EDT 2004';
-try_date 'after 2005';
-try_date 'in the last 3 weeks';
-try_date 'P3M/2006-03-17';
-try_date '2004-01-02/2006-03-17';
-try_date 'P2M6D';
+parse_date 'between 2004-03-12 and last week';
+parse_date 'last week';
+parse_date 'yesterday';
+parse_date 'today 14:00';
+parse_date '3 days before last year at 17:00';
+match_date "$raw_date";
+parse_date 'after 2005';
+parse_date 'in the last 3 weeks';
+parse_date 'P3M/2006-03-17';
+parse_date '2004-01-02/2006-03-17';
+parse_date 'P2M6D';
hunk ./tests/match.pl 108
-try_date '2006/01/19 21:14:20 UTC';
-try_date '2006/01/19 21:14:20 EST';
-try_date '2006/01/19 21:14:20';
+parse_date '2006/01/19 21:14:20 UTC';
+match_date "$year/$mm/$dd $hhmmss";
+match_date "$year/$mm/$dd $hhmmss $tz";
hunk ./tests/match.pl 214
+######
+
+# just be happy if it doesn't complain about the date being fancy
+sub parse_date {
+  my $d = shift;
+  unlike( darcs("changes --match='date $d'"), qr(fancy), "date format $d is recognized" );
+}
+
+sub match_date {
+    my $d = shift;
+    like( darcs(qq(changes --match 'date "$d"')), qr/tester/, "date format $d finds a match");
+
+}
+
+
+
+# Return the date found in the first entry of 'darcs changes';
+sub get_first_date_from_changes {
+    my $out = darcs 'changes';
+    my ($date) = split "  tester", $out;
+    # $date should now look like:  Wed Jan  9 20:02:18 EST 2008
+    return $date;
+}
+
+#
+
+=head2 deconstruct_date
+
+    my ($mon,$mon_num,$day_num,$year,$hhmmss,$tz) = deconstruct_date( $raw_date );
+
+# mon     => 'Jan'
+# mon_num => 01
+# day_num => 09
+# year    => 2008
+# hhmmss  => 01:03:04
+
+Given a date as get_first_date_from_changes() returns, deconstruct it into base components. 
+
+example input: Wed Jan  9 20:02:18 EST 2008
+
+
+
+=cut 
+
+sub deconstruct_date { 
+    my $raw_date  = shift;
+
+    my %month_to_num = (
+        'Jan' => '01',
+        'Feb' => '02',
+        'Mar' => '03',
+        'Apr' => '04',
+        'May' => '05',
+        'Jun' => '06',
+        'Jul' => '07',
+        'Aug' => '08',
+        'Sep' => '09',
+        'Oct' => '10',
+        'Nov' => '11',
+        'Dec' => '12',
+    );
+
+    # example input: Wed Jan  9 20:02:18 EST 2008
+    my ($mon,$day_num,$hhmmss,$tz,$year) = ($raw_date =~ m{
+            \s*
+            \w+              # dow
+            \s+
+            (\w+)            # mon
+            \s+
+            (\d+)            # day
+            \s+
+            (\d\d:\d\d:\d\d) # HH::MM:SS
+            \s+
+            (\w+)            # Time zone abbreviation
+            \s+
+            (\d\d\d\d)       # year
+            \s*
+        }msx);
+    $day_num = '0'.$day_num if (length $day_num == 1);
+    my $mon_num = $month_to_num{$mon};
+
+    return ($mon,$mon_num,$day_num,$year,$hhmmss,$tz);
+}
+
}

[more test script clean-ups, modernization
Mark Stosberg <[EMAIL PROTECTED]>**20080110030955] {
hunk ./tests/merging_newlines.pl 5
+use Test::More 'no_plan';
hunk ./tests/merging_newlines.pl 8
-use Test::More 'no_plan';
+use Shell::Command;
hunk ./tests/merging_newlines.pl 10
-use vars '$DARCS';
-
-die 'darcs not found' unless $ENV{DARCS} || (-x "$ENV{PWD}/../darcs");
-$DARCS = $ENV{DARCS} || "$ENV{PWD}/../darcs";
-
-diag "reality check: ".`$DARCS --version`;
-
-use ExtUtils::Command;
+use warnings;
hunk ./tests/merging_newlines.pl 13
-`mkdir tmp1`;
+mkpath 'tmp1';
hunk ./tests/merging_newlines.pl 15
-`$DARCS init`;
+darcs 'init';
hunk ./tests/merging_newlines.pl 21
-`$DARCS add one.txt`;
-`$DARCS rec -A bar -am "add one.txt"`;
+darcs(q( add one.txt));
+darcs(q( rec -A bar -am "add one.txt"));
hunk ./tests/merging_newlines.pl 33
-`rm -rf tmp2`;
-`darcs get tmp1 tmp2`;
+cleanup 'tmp2';
+darcs 'get tmp1 tmp2';
hunk ./tests/merging_newlines.pl 38
-like(`$DARCS query manifest`, qr/one.txt/, "reality check: manifest");
+like(darcs(q(query manifest)), qr/one.txt/, "reality check: manifest");
hunk ./tests/merging_newlines.pl 44
-like(`$DARCS w -s`, qr/M/, "reality check: darcs w -s");
+like(darcs(q( w -s)), qr/M/, "reality check: darcs w -s");
hunk ./tests/merging_newlines.pl 46
-my $out = `$DARCS rec -A bar -am "add extra line"`;
+my $out = darcs 'rec -A bar -am "add extra line"';
hunk ./tests/merging_newlines.pl 48
-like(`$DARCS push -a` ,qr/conflicts/i,'expect conflicts when pushing');  
+like(darcs(q( push -a)) ,qr/conflicts/i,'expect conflicts when pushing');  
hunk ./tests/merging_newlines.pl 53
-    unlike(`$DARCS resolve`,qr/no conflicts/i, "after a conflict, darcs resolve should report a conflict");
+    unlike(darcs(q(resolve)),qr/no conflicts/i, "after a conflict, darcs resolve should report a conflict");
hunk ./tests/merging_newlines.pl 59
-    `rm -rf $dir`;
+    cleanup "$dir";
hunk ./tests/pending_has_conflicts.pl 5
-use Test::More qw/no_plan/;
-use lib ('lib/perl');
+use Test::More 'no_plan';
+use lib 'lib/perl';
hunk ./tests/pending_has_conflicts.pl 10
-use vars qw/$DARCS/;
-
-die 'darcs not found' unless $ENV{DARCS} || (-x "$ENV{PWD}/../darcs");
-$DARCS = $ENV{DARCS} || "$ENV{PWD}/../darcs";
+use warnings;
hunk ./tests/pending_has_conflicts.pl 29
-my $revert_output = `echo y | $DARCS revert -a 2>&1`;
+my $revert_output = `echo y | "$DARCS" revert -a 2>&1`;
hunk ./tests/workingdir.pl 5
-use Test::More qw/no_plan/;
-use lib ('lib/perl');
+use Test::More 'no_plan';
+use lib 'lib/perl';
hunk ./tests/workingdir.pl 34
-darcs 'record -am "a" --author me';
+darcs 'record -am "aa" --author me';
hunk ./tests/workingdir.pl 43
-darcs 'record -am "b" --author me';
+darcs 'record -am "bb" --author me';
hunk ./tests/workingdir.pl 46
-darcs 'record -am "d" --author me';
-darcs 'tag 1 --author me';
+darcs 'record -am "dd" --author me';
+my $out = darcs 'tag 1 --author me';
hunk ./tests/workingdir.pl 53
-darcs 'get wtemp1 wtemp2 --to-patch a';
+darcs 'get wtemp1 wtemp2 --to-patch aa';
hunk ./tests/workingdir.pl 62
-  darcs 'get wtemp1 wtemp2 --to-patch a';
+  darcs 'get wtemp1 wtemp2 --to-patch aa';
}

Context:

[resolve conflict.
David Roundy <[EMAIL PROTECTED]>**20080111160045] 
[Conflict backup files are boring.
Trent W. Buck <[EMAIL PROTECTED]>**20080110163822] 
[more boring extensions
[EMAIL PROTECTED]
 Added extensions for CLISP, CMUCL, and "part" files which result in
 failed KDE copy operations.
] 
[resolve conflict in Libwww.
David Roundy <[EMAIL PROTECTED]>**20080110234609] 
[Some error reporting for libwww.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080110221921] 
[add optional support for using the pure haskell Network.HTTP http implementation
John Meacham <[EMAIL PROTECTED]>**20080110215859] 
[make darcs-2 repositories store patches in more-nicely-formated format
David Roundy <[EMAIL PROTECTED]>**20080110220413] 
[fix filename encoding issue in ShowFiles.
David Roundy <[EMAIL PROTECTED]>**20080110204120] 
[add debug message when grabbing files using libcurl.
David Roundy <[EMAIL PROTECTED]>**20080110202200] 
[make using libwww no longer the default, even if it's present.
David Roundy <[EMAIL PROTECTED]>**20080110195753
 There is a bug in our libwww bindings that I haven't located... if it isn't
 fixed, we should definitely remove this binding before the darcs 2.0
 release.
] 
[make Libwww.copyUrls provide debug output.
David Roundy <[EMAIL PROTECTED]>**20080110195733] 
[test: Exibit a falling test about rollback.
[EMAIL PROTECTED]
 Indeed  the only test about rollback was br0ken by a prior test that creates a
 directory  and  remove  read  permissions  to  it.  The  rollback test do some
 records  that  silently  fail  by lack of permissions, finally the rollback is
 cancelled since the named patch doesn't exist.
 This shows that rollback need some care.
] 
[Canonize Gwern Branwen, Nicolas Pouillard, Eric Kow.
Eric Kow <[EMAIL PROTECTED]>**20080109152727] 
[Eliminate configure test for Text.PrettyPrint.
Eric Kow <[EMAIL PROTECTED]>**20080109152927] 
[Use our own Printer instead of Text.PrettyPrint (make_changelog).
Eric Kow <[EMAIL PROTECTED]>**20080109172910] 
[Add parens functionality to the printer code.
Eric Kow <[EMAIL PROTECTED]>**20080109144956] 
[restore behavior where we display conflicts in --summary mode.
David Roundy <[EMAIL PROTECTED]>**20080110004605] 
[regression test for issue406
Mark Stosberg <[EMAIL PROTECTED]>**20080109044500] 
[issue567: regression test for moving a file to the same location as itself
Mark Stosberg <[EMAIL PROTECTED]>**20080109032346] 
[fix latex bug in docs.
David Roundy <[EMAIL PROTECTED]>**20080108211102] 
[fix latex bug in docs.
David Roundy <[EMAIL PROTECTED]>**20080108205912] 
[fix bug in show_tags.sh cleanup.
David Roundy <[EMAIL PROTECTED]>**20080108204430] 
[doc,typo: some s/darcs commit/darcs record/
[EMAIL PROTECTED] 
[test: Add a test for darcs show tags.
[EMAIL PROTECTED] 
[document the three repo format flags for "darcs init"
Mark Stosberg <[EMAIL PROTECTED]>**20080108041024] 
[improve the one-paragraph docs for "darcs init"
Mark Stosberg <[EMAIL PROTECTED]>**20080108040941] 
[Quit defining inventory format options recursively. Provide user-oriented descriptions.
Mark Stosberg <[EMAIL PROTECTED]>**20080108035256] 
[update partial.sh to show off improved darcs-2/partial functionality
Mark Stosberg <[EMAIL PROTECTED]>**20080108024712] 
[typo and bug fix in partial.sh.
Mark Stosberg <[EMAIL PROTECTED]>**20080108022808
 
 It turned out the call to "darcs optimize" was silently failing to create a checkpoint
 because there was no tag. This caused the remaining tests for --partial to run against 
 a full repo, not a partial one. 
] 
[issue55: document that darcs handles some types of binary files automatically. 
Mark Stosberg <[EMAIL PROTECTED]>**20080108010043] 
[correct apparent typo in test.
Mark Stosberg <[EMAIL PROTECTED]>**20080108005710
     The fix made more sense than the former behavior of comparing a file to itself. 
] 
[prevent warning in test script and remove mysterious exit(1) call.
Mark Stosberg <[EMAIL PROTECTED]>**20080106052622] 
[issue395: eliminate patches with a single character name from shell scripts in the test suite.
Mark Stosberg <[EMAIL PROTECTED]>**20080106051821] 
[issue526: improve Perl test suite.
Mark Stosberg <[EMAIL PROTECTED]>**20080106045548
     - better compatibility when path to darcs includes a space
     - better portability by eliminating some system calls
     - general style improvements
] 
[minor white-space and code style improvements
Mark Stosberg <[EMAIL PROTECTED]>**20080105183641] 
[typo fix on GNUmakefile comment
Mark Stosberg <[EMAIL PROTECTED]>**20080105183027] 
[refactor: improve style and portability of pull.pl test script.
Mark Stosberg <[EMAIL PROTECTED]>**20080105181751
     Many direct system calls were eliminated. No functional changes.  
] 
[add feature requested in issue576.
David Roundy <[EMAIL PROTECTED]>**20080105150125] 
[fix bug in issue576.
David Roundy <[EMAIL PROTECTED]>**20080105144929] 
[add test that triggers bug in issue576.
David Roundy <[EMAIL PROTECTED]>**20080105144812] 
[add configure support for libwww.
David Roundy <[EMAIL PROTECTED]>**20080104201255] 
[make bug message more explicit.
David Roundy <[EMAIL PROTECTED]>**20080104004253] 
[Initial implementation of HTTP pipelining using libwww.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20071222144902] 
[Make sure we test the 'darcs' we just built and not one in a global path.
Mark Stosberg <[EMAIL PROTECTED]>**20080102002235
     This done by using "$DARCS" instead of 'darcs'.
     However, in my case the updated test FAILS unexplainably with 2.0.0pre3,
     by failing to detect that a file has changed. 
     If I follow along in a shell and run the same commands with Darcs 2, 
     the problem does not appear. 
] 
[issue347 - document that single quotes should be used in .darcs/defaults
Mark Stosberg <[EMAIL PROTECTED]>**20080101164428] 
[make indent slightly more concise using lines and unlines.
David Roundy <[EMAIL PROTECTED]>**20080104003953] 
[refactor: replace recursive indent with more concise find-and-replace syntax
Mark Stosberg <[EMAIL PROTECTED]>**20080101200447] 
[simplify (and debug) pending handling.
David Roundy <[EMAIL PROTECTED]>**20071227133618
 Note that this change could lead to performance regressions, but I believe
 that these regressions would be strongly bounded (never worse than a
 whatsnew), and this simplification makes the code much easier to safely
 modify.
] 
[make updating of pending on pull much more efficient.
David Roundy <[EMAIL PROTECTED]>**20071224131059] 
[simplify a bit of code.
David Roundy <[EMAIL PROTECTED]>**20071224131023] 
[fix type-witness bug in HopefullyPrivate.
David Roundy <[EMAIL PROTECTED]>**20071223141149] 
[simplify Get
David Roundy <[EMAIL PROTECTED]>**20071223025108] 
[simplify tentativelyAddPatch by removing unused return value.
David Roundy <[EMAIL PROTECTED]>**20071223024400] 
[simplify away np2prims and nps2prims.
David Roundy <[EMAIL PROTECTED]>**20071223022145] 
[try to avoid rewriting patches that we've just read.
David Roundy <[EMAIL PROTECTED]>**20071222190029] 
[generalize CommandsAux utility functions.
David Roundy <[EMAIL PROTECTED]>**20071222162952] 
[add new instances for PatchInfoAnd.
David Roundy <[EMAIL PROTECTED]>**20071222144439] 
[change tentativelyAddPatch to accept a PatchInfoAnd p.
David Roundy <[EMAIL PROTECTED]>**20071222140517] 
[internal prepration for optimization saving patch writing.
David Roundy <[EMAIL PROTECTED]>**20071222134834] 
[add changelog entry.
David Roundy <[EMAIL PROTECTED]>**20071219162646] 
[add fixme indicating where the code could be simplified.
David Roundy <[EMAIL PROTECTED]>**20071221135649] 
[make reading of hashed inventories lazier.
David Roundy <[EMAIL PROTECTED]>**20071221133453] 
[resolve conflicts in mv_and_remove_tests.sh.
David Roundy <[EMAIL PROTECTED]>**20071219144638] 
[Fix !(...|...) in mv_and_remove_tests.sh.
Dave Love <[EMAIL PROTECTED]>**20071218001826
 Assume the original construct should have been `! ... | ...' and
 replace with a portable version of that.
] 
[[issue571] Redo last HAVE_TERMIO_H fix.
Dave Love <[EMAIL PROTECTED]>**20071218140508
 Not the most direct fix, but simpler.
] 
[Fix configure test for gadt type witnesses.
Dave Love <[EMAIL PROTECTED]>**20071218120139] 
[use --ignore-times in all tests.
David Roundy <[EMAIL PROTECTED]>**20071217225159
 This is because the hashed repository is a bit pickier, in that
 it no longer checks file lengths when the file modification times
 match.
] 
[enable modification time checking on hashed repositories.
David Roundy <[EMAIL PROTECTED]>**20071217220237] 
[Pass two args to `cmp' in tests, following POSIX.
Dave Love <[EMAIL PROTECTED]>**20071216180503
 Fixes some failures on Solaris.
] 
[resolve silly conflict with myself.
David Roundy <[EMAIL PROTECTED]>**20071217200855] 
[clean up SelectChanges (eliminating Bools)
David Roundy <[EMAIL PROTECTED]>**20071217191809] 
[make a few more files compile with type witnesses.
David Roundy <[EMAIL PROTECTED]>**20071217183234] 
[fix bug in revert (in writing the unrevert file).
David Roundy <[EMAIL PROTECTED]>**20071216215225] 
[make a few more files compile with type witnesses.
David Roundy <[EMAIL PROTECTED]>**20071217164815] 
[remove tabs.
David Roundy <[EMAIL PROTECTED]>**20071216224617] 
[bump version number preemptively to 2.0.0pre3.
David Roundy <[EMAIL PROTECTED]>**20071216222823] 
[fix doc bug in show contents.
David Roundy <[EMAIL PROTECTED]>**20071216214002] 
[TAG 2.0.0pre2
David Roundy <[EMAIL PROTECTED]>**20071216201647] 
Patch bundle hash:
bf5d2312d7899a55bb83342f1be59c4886c476d3
_______________________________________________
darcs-devel mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-devel

Reply via email to