[darcs-devel] darcs patch: Fix RT#266

Tomasz Zielonka tomasz.zielonka at gmail.com
Thu Mar 17 04:20:12 PST 2005


Only a fix at this moment. Later I am going to clean up related code.

Best regards
Tomasz
-------------- next part --------------

New patches:

[Fix RT#266. Introduce is_symlink instead of isnt_symlink.
Tomasz Zielonka <tomasz.zielonka at gmail.com>**20050317121210] {
hunk ./Lock.lhs 248
-foreign import ccall unsafe "static compat.h isnt_symlink" isnt_symlink
+foreign import ccall unsafe "static compat.h is_symlink" is_symlink
hunk ./Lock.lhs 255
-       else withCString f $ \cf-> (0/=) `liftM` isnt_symlink cf
+       else withCString f $ \cf-> (0==) `liftM` is_symlink cf
hunk ./SlurpDirectory.lhs 149
-foreign import ccall unsafe "static compat.h isnt_symlink" isnt_symlink
+foreign import ccall unsafe "static compat.h is_symlink" is_symlink
hunk ./SlurpDirectory.lhs 154
-    withCString f $ \cf -> do notsym <- isnt_symlink cf
-                              return $ notsym == 0
+    withCString f $ \cf -> do sym <- is_symlink cf
+                              return $ sym /= 0
hunk ./compat.c 216
-int isnt_symlink(const char *file) {
-    return 1; /* FIXME: should ignore windows shortcuts */
+int is_symlink(const char *file) {
+    return 0; /* FIXME: should ignore windows shortcuts */
hunk ./compat.c 316
-int isnt_symlink(const char *file) {
+int is_symlink(const char *file) {
hunk ./compat.c 318
-  if (lstat(file, &buf)) return 0; /* treat error as symlink */
-  return !S_ISLNK(buf.st_mode);
+  if (lstat(file, &buf)) return 0; /* treat error as non-symlink */
+  return S_ISLNK(buf.st_mode);
hunk ./compat.h 24
-int isnt_symlink(const char *file);
+int is_symlink(const char *file);
hunk ./tests/add.pl 56
-TODO: {
-    local $TODO = 'waiting on code fix';
+{
}

Context:

[Declare sloppy_atomic_create
Nigel Rowe <rho at swiftdsl.com.au>**20050314105803
 Eliminate warning when compiling Lock.lhs
] 
[[RT#268] Ship Test::Harness and Test::More
schwern at pobox.com**20050313195506
 
 So we don't have to worry about what version of the Test modules users have,
 just ship em with darcs.  They're small.
 
 PS  I threw in the Test::Tutorial and Test::TAP files even though they're just
 documentation.  Makes upgrading easier (can just copy everything, don't have
 to worry about other files), they're small and who knows, someone might
 actually read them.
] 
[typo fix - stray bracket in '--with-wx' help
Martin Bays <mbays at freeshell.org>**20050312203521] 
[a TODO test which confirms that RT#266 is a regression
Mark Stosberg <mark at summersault.com>**20050312220846
 
 I suspect of the recent symlink patches introduced this. 
 Search 'darcs changes' for 'sym' to find it. 
] 
[RT#152 a TODO test for resolve after a conflict
Mark Stosberg <mark at summersault.com>**20050312035601
 
 When pushing a conflict, darcs reports "There is a conflict".
 However, running 'darcs resolve' in the repo with the conflict
 reports no conflict. That seems like a big.
] 
[RT#10 demostrate conflict resolution bug is resolved
Mark Stosberg <mark at summersault.com>**20050312024532
 
 I translated the original shell script into (mostly!) Perl.
 
 I also tried running the shell script, and it passed to.
 
 It appears this bug has been fixed.
 
 Having this test in the test suite will help to prevent a regression.
 
     Mark
] 
[Allow parens to be optional when calling darcs() test command in some cases.
Mark Stosberg <mark at summersault.com>**20050312142220] 
[Test::Darcs.  darcs() instead of `$DARCS ...`
schwern at pobox.com**20050312031120
 
 All the perl tests repeat this mantra to find darcs:
 
   use vars qw/$DARCS/;
 
   die 'darcs not found' unless $ENV{DARCS} || (-x "$ENV{PWD}/../darcs");
   $DARCS = $ENV{DARCS} || "$ENV{PWD}/../darcs";
 
 And then they call $DARCS directly via a shell command.  `$DARCS ...`
 Repeated code is bad and all that shell is likely to become a compatibility
 liability.
 
 This patch creats a library Test::Darcs and in it darcs() which replaces
 `$DARCS ...`.  I've converted add.pl to use it as a demonstration.
 
 One of the issues is now in order to run an individual Perl test file you
 must add -Ilib/perl so it can find Test::Darcs.  Alternatively one can 
 add "use lib qw(lib/perl)" to all the Perl tests.  I don't know which is
 better for darcs developers.  The latter is redundant but potentially less
 confusing.
 
 More testing libraries for tests/lib/perl to follow.
 
] 
[fix bug in merger tests.
David Roundy <droundy at abridgegame.org>**20050210131025] 
[copyedit section about special patches and pending in best_practices
Martin Bays <mbays at freeshell.org>**20050311211035] 
[fix typo: 'n -> \n
Martin Bays <mbays at freeshell.org>**20050312175555] 
[turn wishful test into a TODO block so test script will succeed
Mark Stosberg <mark at summersault.com>**20041214024314] 
[test for changes --last affecting only given files
Mark Stosberg <mark at summersault.com>**20041026122610
 
 I added a test to confirm that "--last" only considers patches that
 the given files are in.
 
 It fails now because this is not implemented yet. You can save this test until
 you are ready to do that. :)
 
     Mark
] 
[MOre ChangeLog updates
Mark Stosberg <mark at summersault.com>**20050312140805] 
[get rid of needless warnings in test suite run.
Mark Stosberg <mark at summersault.com>**20050312140247
 
 Thanks to Schwern for pointing this out. 
] 
[RT #255 Comprehensible shell test output
schwern at pobox.com**20050311212647] 
[typo fix - s/direcotry/directory/
Mark Stosberg <mark at summersault.com>**20050311150658] 
[refuse to use mmap on nfs systems.
David Roundy <droundy at abridgegame.org>**20050311123821] 
[fix short description of --tag-name (which should be just --tag) in optimize.
David Roundy <droundy at abridgegame.org>**20050310130040] 
[command description and help patch
peter at syncad.com**20050309230427] 
[RT#165 - TODO test for pull/rollback bug
Mark Stosberg <mark at summersault.com>**20050310031811] 
[another TODO test for mv with absolute paths. This one is for the target argument.
Mark Stosberg <mark at summersault.com>**20050309210815] 
[add TODO test for mv with absolute paths
Mark Stosberg <mark at summersault.com>**20050309210134
 
 I'm using the ExtUtils::Command module as a perceived improvement for
 portability for some Unixy comands. It's part of the core Perl distribution so
 every should have it. (Although there are still more system calls which could
 be converted). 
 
     Mark
 
] 
[record.pl conflict resolution and new tests
Mark Stosberg <mark at summersault.com>**20050309135405] 
[adding test for 'record --logfile'
Mark Stosberg <mark at summersault.com>**20041211213218] 
[provide example e-mail address format in prompt.
Mark Stosberg <mark at summersault.com>**20050310023528] 
[make slurp_read_and_write_dirty respect --set-scripts-executable.
David Roundy <droundy at abridgegame.org>**20050309135827] 
[recommend that test suite is run as part of the install process
Mark Stosberg <mark at summersault.com>**20050308174621] 
[add section about special patches and pending to best_practices
Tommy Pettersson <ptp at lysator.liu.se>**20050307213134] 
[RT#143, adding ChangeLog entry
Mark Stosberg <mark at summersault.com>**20050308151004] 
[make record.pl a TODO test and s/darcs/\$DARCS/.
David Roundy <droundy at abridgegame.org>**20050309122530] 
[bugfix reverse without invert for pull_lasts in PatchChoices
Tommy Pettersson <ptp at lysator.liu.se>**20050308165709
 The buggy return value is not used at present, but it migth be some day.
] 
[more changelog updates: mention diff, unrecord, unpull and put improvements
Mark Stosberg <mark at summersault.com>**20050309002610] 
[RT#247: a TODO test for files name "\"
Mark Stosberg <mark at summersault.com>**20050309025808
 
 The TODO block can be removed when the code is updated for the test to pass.
] 
[convert whatsnew-with-absolutes-paths tests to a TODO test.
Mark Stosberg <mark at summersault.com>**20050309025427
 
 TODO tests still 'succeed' when the test fails, thus test should now be OK to
 'apply' to darcs before the code is written to match it. Hopefully, it may even
 be an incentive to help get started on that. 
 
] 
[switch to more portable constructs.
Mark Stosberg <mark at summersault.com>**20050309025351] 
[test for record with absolute paths (current failing)
Mark Stosberg <mark at summersault.com>**20041024000931] 
[a test for whatsnew with absolute paths
Mark Stosberg <mark at summersault.com>**20041023235658
 It was recently reported on the -users list that 'whatsnew' doesn't work with absolute paths.
 This test confirms that bug (It current fails). 
] 
[tag needs author flag in tag.pl test.
David Roundy <droundy at abridgegame.org>**20050308131311] 
[document add command with symbolic links and boring option
Tommy Pettersson <ptp at lysator.liu.se>**20050308105604] 
[fix bug in new tag code pointed out by Mark (which caused his tests to fail).
David Roundy <droundy at abridgegame.org>**20050308125801] 
[some tests for darcs tag.
Mark Stosberg <mark at summersault.com>**20050308033818
 
 These tests were made to verify the new functionality by Josef
 to include the tag name on the command line. 
 
 Currently there are two failing tests which illustrate that success is being reported
 different in this case, and more importantly, that the patch names generated are in 
 a new format which does include 'tagged' in the name. 
] 
[improve doc for tag name
Mark Stosberg <mark at summersault.com>**20050308033739] 
[Command tag now accepts patchname on the command line
Josef Svenningsson <josef.svenningsson at gmail.com>**20050306013356] 
[user must confirm choice 'a' for unrecord and unpull
Tommy Pettersson <ptp at lysator.liu.se>**20050306201403] 
[update test suite for new multi-select interface to unrecord and unpull
Tommy Pettersson <ptp at lysator.liu.se>**20050306185536] 
[make unrecord and unpull use same interface as pull, to select multiple patches
Tommy Pettersson <ptp at lysator.liu.se>**20050306183140] 
[add function commute_to_end to Depends
Tommy Pettersson <ptp at lysator.liu.se>**20050306173752] 
[add function with_selected_last_changes_reversed to SelectChanges
Tommy Pettersson <ptp at lysator.liu.se>**20050306141917] 
[make remove_from_unrevert_context take a list of patches
Tommy Pettersson <ptp at lysator.liu.se>**20050306140701
 This will enable unpull and unrecord en masse
] 
[Better error message when trying to add a symbolic link
chucky at dtek.chalmers.se**20050305134958] 
[fix MacOS hard link HFS+ problem with GUI editors.
David Roundy <droundy at abridgegame.org>**20050305151537
 On HFS+, MacOS X has to emulate hard links, since they don't exist on the
 filesystem.  It does this moderately well, but many editors (including
 xcode, which is written by Apple) can't handle files that have formerly had
 hard links made.  All files created by darcs were in this category, since
 we reused our lock-grabbing code to create files.  I've modified the code
 to instead use the sloppy lock-grabbing code when we just want to create a
 file (which isn't really a lock).  This *should* fix the bug on MacOS X.
] 
[add explanatory comment regarding snprintf on win32.
David Roundy <droundy at abridgegame.org>**20050305150309
 It's amazing some of the stuff I've learned working on darcs!
] 
[Fix an off-by-one bug in win32 mkstemp.
Josef Svenningsson <josef.svenningsson at gmail.com>**20050303151956] 
[add (optional) statistics output to list_authors.
David Roundy <droundy at abridgegame.org>**20050305134613
 I was just curious...
] 
[fix LaTeX markup: ellipsis and a dash
Tommy Pettersson <ptp at lysator.liu.se>**20050224021423] 
[fix broken footnote in best_practises
Tommy Pettersson <ptp at lysator.liu.se>**20050304003052] 
[update docs to reflect how darcs mv (and unix mv) actually work.
Mark Stosberg <mark at summersault.com>**20050228192022
 
 I also updated the help syntax to use brackets, like 'darcs record' does.
] 
[Fix path to pending_buggy in user message
Thomas Zander <TZander at Factotummedia.nl>**20050225135841] 
[when patch has already been applied, exit with nicer message.
David Roundy <droundy at abridgegame.org>**20050226134928] 
[Improve diagnostic message with apply refuses to patch.
Mark Stosberg <mark at summersault.com>**20050226033747
 
 Sometimes it's confusing when apply refuses to apply a patch
 that would cause a conflict. 
 
 This is a documentation patch which explains to the user who to 
 cause darcs to apply the patch and mark the conflicts anyway, 
 if that's what they want. 
] 
[eliminate inappropriate singular flags in changes.
David Roundy <droundy at abridgegame.org>**20050225123849] 
[sort commands in "Ambiguous command" message.
David Roundy <droundy at abridgegame.org>**20050220141036] 
[Help texts clarification
Thomas Zander <zander at kde.org>**20050219165049] 
[don't import head twice (fixes ghc 6.4 warning).
David Roundy <droundy at abridgegame.org>**20050219120649] 
[move nubsort from PatchCommute to DarcsUtils
Benedikt Schmidt <beschmi at cloaked.de>**20050219100534
 and change all nub . sort calls to nubsort.
] 
[fix get over sftp using the putty sftp client
Benedikt Schmidt <beschmi at cloaked.de>**20050219095413
 psftp doesn't change to the directory given on the commandline as
 user at host:dir. Change url given as arg to user at host: and add a
 cd dir command to the batchfile.
] 
[add exec_interactive and use it instead of system in some places
Benedikt Schmidt <beschmi at cloaked.de>**20050218022204
 exec_interactive just uses rawSystem wich works on posix systems
 (using execvp) and should work on windows too.
] 
[clarify message and nub . sort instead of other way around
Benedikt Schmidt <beschmi at cloaked.de>**20050218014042] 
[merge_three_patches-test-use-DARCS-not-darcs-for-get-tempOld-tempB
petersen at haskell.org**20050217052705] 
[fix bug in what_sl test.
David Roundy <droundy at abridgegame.org>**20050217133957] 
[fix non-matching regexp in unit test
Will <will at glozer.net>**20050217074209] 
[add self-test routines to cgi
Will <will at glozer.net>**20050217071519] 
[canonize peter strand.
David Roundy <droundy at abridgegame.org>**20050217130626] 
[Revert to old behaviour for "whatsnew -sl" wrt. showing modified files (bug #210 in RT)
peter at zarquon.se**20050216231858] 
[#217: darcs test suite ignores ~/.darcs
Yuval Kogman <nothingmuch at woobling.org>**20050216000637
 Every test run has env HOME=`pwd` prepended to it, which causes darcs to look
 for .darcs in the src/darcs/test directory, instead of the actual home of the
 user running the test suite.
] 
[Less ambiguous (and context-insensitive) docpatch for --look-for-adds
Yuval Kogman <nothingmuch at woobling.org>**20050215233402
 lookforadds is documented in a way that could be interpreted as 'running "darcs
 whatsnew -l" will add files to the repo'. This doc patch tries to clarify the
 issue, but does a bad job of it.
 
 The reason is that lookforadds is documented once, while it actually means two
 different things in two different contexes - recording, and whatsnewing. The
 changed texts try to make sense in both contexes.
 
 Splitting the lookforadds documentation is beyond me, as it requires code
 modifications, but would definately be the Right Thing to do.
] 
[add -lposix4 -lpthread to LDFLAGS when present, needed on Solaris
Samuel Tardieu <sam at rfc1149.net>**20050214170152] 
[fixes to make darcs work with ghc 6.4.
David Roundy <droundy at abridgegame.org>**20050212125212] 
[quote filename passed to $EDITOR
Benedikt Schmidt <beschmi at cloaked.de>**20050210193135
 fix bug when working directory contains spaces reported by
 Steven E. Harris.
] 
[change tab to spaces.
David Roundy <droundy at abridgegame.org>**20050207131451] 
[improvements for darcs add and adding parent directories
Benedikt Schmidt <beschmi at cloaked.de>**20050206000516
 Don't check for parents of recursively added files and
 order files given on commandline. Add test for new
 behaviour.
] 
[index.html.in: "Darcs is a revision control system."
Thomas Schwinge <schwinge at nic-nac-project.de>**20050206150322
 I'd suggest this change; IMHO there's no need to compare darcs to CVS.
] 
[Remove doubled 'on' from index.html.in.
Thomas Schwinge <schwinge at nic-nac-project.de>**20050206145156] 
[RT#201 - add test for takeLock failure on pull
Mark Stosberg <mark at summersault.com>**20050206040412] 
[changelog updates
Mark Stosberg <mark at summersault.com>**20050206030948] 
[canonize AJ... :)
David Roundy <droundy at abridgegame.org>**20050205212437] 
[Beautification
Ian Lynagh <igloo at earth.li>**20050205131851] 
[clarify how bad the situation is when failure happens in pull.
David Roundy <droundy at abridgegame.org>**20050205135901
 This adds a function to DarcsUtils which can be used to add clarifications
 to existing error messages, so no information is lost to the user (although
 calling functions lose the type of the exception that was thrown).  It
 would be a good idea to throw these clarifications around pretty
 liberally.  I just did this to pull because that's where the relevant bug
 report (#201) was filed.
 
 I also reordered the writing to pending so less information will be lost if
 there is a problem writing changes to the working directory.
] 
[be more careful not to do unnecesary slurps in write_pending.
David Roundy <droundy at abridgegame.org>**20050201115209] 
[Update copyright message: 2002-2005
Jan-Benedict Glaw <jbglaw at lug-owl.de>**20050131133625] 
[Build-depend on libcurl2 or libcurl3
Jan-Benedict Glaw <jbglaw at lug-owl.de>**20050131133404
 
 Darcs builds perfectly okay with libcurl3, so there's no need to force
 using an older version of this lib.
 
] 
[Show patch number while (verbosely) downloading patches
Jan-Benedict Glaw <jbglaw at lug-owl.de>**20050131121046] 
[Close both ends of pipes.
Jan-Benedict Glaw <jbglaw at lug-owl.de>**20050130201542] 
[try to avoid email loops.
David Roundy <droundy at abridgegame.org>**20050129150828] 
[Show files starting with . in CGI script
Kim Hansen <kim.hansen at hp.com>**20050128180541
 Files like .htaccess were not shown i the web interface.
 This patch changes the use of glob to opendir/readdir/closedir.
 It also shows repositories starting with ..
] 
[Fix soul-hurting hardcoded file descriptor number
Jan-Benedict Glaw <jbglaw at lug-owl.de>**20050127235644] 
[Fix eye-hurting whitespace
Jan-Benedict Glaw <jbglaw at lug-owl.de>**20050127234921
 
 I admit that I don't like indenting with whitespaces either,
 but since the file is basically written with 4-spaces, I'll
 keep this habit (unless anybody allows me to send a larger
 patch :-)
 
] 
[Fix off-by-one error in WIN32 version of mkstemp()
Jan-Benedict Glaw <jbglaw at lug-owl.de>**20050127234048
 
 This patch solves different issues with the mkstemp() funktion provided
 for WIN32 versions of darcs:
 
 - THIS PATCH IS NOT TESTED: I'VE GOT NO WINDOWS AROUND!
 - Move file-local variable into the mkstemp() since it's only used
   by mkstemp().
 - Remove unneeded variable p2.
 - Remove unneeded variable fd by directly returning the result of
   open().
 - Correctly return EINVAL if the supplied template isn't at least
   6 bytes long and doesn't end in 6 consecutive 'XXXXXX'.
 - Write 6 bytes of hex garbage instead of 5 bytes of decimal garbage.
   This was caused because the final \0 wasn't put into account for
   the snprintf() call.
] 
[Clarified success message for darcs pull.
jemfinch at supybot.com**20050127065323
 When I first ran darcs pull, I saw the success message "Finished pulling" and
 wondered whether Darcs had just downloaded the patches, or whether it had
 also applied them.  To me (a new Darcs user) "pull" sounds like an exclusively
 network operation, so I wasn't sure whether the patches would be applied.  I
 think adding "and applying" clarifies to users that darcs pull not only grabs
 the patches, but applies them as well.
] 
[simplify slurp_has using get_slurp
Tomasz Zielonka <tomasz.zielonka at gmail.com>**20041221193648] 
[simplify slurp_hasfile using get_slurp
Tomasz Zielonka <tomasz.zielonka at gmail.com>**20041221182015] 
[simplify slurp_modfile using get_slurp_context
Tomasz Zielonka <tomasz.zielonka at gmail.com>**20041221175117] 
[implement get_slurp using get_slurp_context
Tomasz Zielonka <tomasz.zielonka at gmail.com>**20041221170352] 
[simplify addslurp using get_slurp_context
Tomasz Zielonka <tomasz.zielonka at gmail.com>**20041221140040] 
[simplify slurp_remove using get_slurp_context_maybe
Tomasz Zielonka <tomasz.zielonka at gmail.com>**20041221131818] 
[add get_slurp_context, get_slurp_context_maybe and get_slurp_context_list
Tomasz Zielonka <tomasz.zielonka at gmail.com>**20041221064941
 These functions allow to split a slurpy to a subtree specified by a file path
 and the rest of the tree (context). Hopefully this will allow to move most
 of slurpy traversal code to one place.
] 
[automatically add parent directories for darcs add
Benedikt Schmidt <beschmi at cloaked.de>**20050205014603
 
 Instead of complaining that the parent directory of the file isn't
 in the repo, add parent directories recursively. (See Bug #20)
] 
[update web page to reflect new stable release.
David Roundy <droundy at abridgegame.org>**20050205120152] 
[make favicon alpha transparent.
David Roundy <droundy at abridgegame.org>**20050205115820] 
[TAG 1.0.2
David Roundy <droundy at abridgegame.org>**20050204123805] 
Patch bundle hash:
86a9a5385fbfbf8543ab14222fdd6f8fe0dabb00


More information about the darcs-devel mailing list