Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r1595 - trunk: . fsvs fsvs/src fsvs/tests

fsvs
Discussion topic

Back to topic list

svn commit: r1595 - trunk: . fsvs fsvs/src fsvs/tests

Author pmarek
Full name P.Marek
Date 2008-04-08 23:46:13 PDT
Message Author: pmarek
Date: 2008-04-08 23:46:13-0700
New Revision: 1595

Modified:
   trunk/ (props changed)
   trunk/fsvs/CHANGES
   trunk/fsvs/src/diff.c
   trunk/fsvs/tests/026_diff

Log:
Remove temporary files even on EPIPE and similar.


Modified: trunk/fsvs/CHANGES
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/CHANGES​?view=diff&rev=1​595&p1=trunk/fsv​s/CHANGES&p2=tru​nk/fsvs/CHANGES&​r1=1594&r2=1595
====================​====================​====================​==================
--- trunk/fsvs/CHANGES (original)
+++ trunk/fsvs/CHANGES 2008-04-08 23:46:13-0700
@@ -8,6 +8,8 @@
 - Fixed EPIPE handling in many functions, most notably on "fsvs st" output.
 - The colordiff option has changed; it can now be used to specify the
     binary to use instead of the default "colordiff".
+- "fsvs diff" would leave a temporary file behind if the colordiff binary
+ quits unexpectedly, or a EPIPE was caught.
 
 Changes since 1.1.13
 - New option for conflict handling; allows "stop" (historical default),

Modified: trunk/fsvs/src/diff.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/dif​f.c?view=diff&re​v=1595&p1=trunk/​fsvs/src/diff.c&​p2=trunk/fsvs/src/di​ff.c&r1=1594​&r2=1595
====================​====================​====================​==================
--- trunk/fsvs/src/diff.c (original)
+++ trunk/fsvs/src/diff.c 2008-04-08 23:46:13-0700
@@ -599,10 +599,12 @@
 int df__work(struct estat *root, int argc, char *argv[])
 {
     int status;
+ int i, deinit;
     char **normalized;
 
 
     status=0;
+ deinit=1;
     /* Default to non-recursive. */
     opt_recursive--;
 
@@ -615,6 +617,7 @@
     signal(SIGTERM, df___signal);
     signal(SIGHUP, df___signal);
 
+
     /* check for colordiff */
     if (( opt__get_int(OPT__COLORDIFF)==0 ||
                 opt__doesnt_say_off(​opt__get_string(OPT_​_COLORDIFF)) ) &&
@@ -632,9 +635,16 @@
                 "!No WAA information found; you probably didn't commit.");
     STOPIF( status, "No working copy base found?");
 
- STOPIF( df___cleanup(), NULL);
 
 ex:
+ if (deinit)
+ {
+ deinit=0;
+ i=df___cleanup();
+ if (!status && i)
+ STOPIF(i, NULL);
+ }
+
     return status;
 }
 

Modified: trunk/fsvs/tests/026_diff
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/tests/0​26_diff?view=diff​&rev=1595&p1=tr​unk/fsvs/tests/026_d​iff&p2=trunk/fsv​s/tests/026_diff​&r1=1594&r2=1595​
====================​====================​====================​==================
--- trunk/fsvs/tests/026_diff (original)
+++ trunk/fsvs/tests/026_diff 2008-04-08 23:46:13-0700
@@ -111,6 +111,13 @@
   $SUCCESS "Reports bad names for colordiff"
 fi
 
+# No temporary file may be left behind.
+if ls $copy.* 2> /dev/null
+then
+ $ERROR "Temporary file left behind."
+fi
+
+
 # True immediately exits
 if $BINdflt diff $copy -o colordiff=true > /dev/null 2>&1
 then
@@ -119,6 +126,13 @@
   $SUCCESS "Reports stopping colordiffs"
 fi
 
+# No temporary file may be left behind.
+if ls $copy.* 2> /dev/null
+then
+ $ERROR "Temporary file left behind."
+fi
+
+
 # EPIPE?
 if $BINdflt diff $copy -o colordiff=cat | true
 then
@@ -127,4 +141,10 @@
   $ERROR "Doesn't handle EPIPE"
 fi
 
+# No temporary file may be left behind.
+if ls $copy.* 2> /dev/null
+then
+ $ERROR "Temporary file left behind."
+fi
+

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r1595 - trunk: . fsvs fsvs/src fsvs/tests pmarek P.Marek 2008-04-08 23:46:13 PDT
Messages per page: