Login | Register
My pages Projects Community openCollabNet

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

fsvs
Discussion topic

Back to topic list

svn commit: r1554 - trunk: . fsvs fsvs/src fsvs/src/dox fsvs/tests

Author pmarek
Full name P.Marek
Date 2008-03-18 23:41:45 PDT
Message Author: pmarek
Date: 2008-03-18 23:41:44-0700
New Revision: 1554

Added:
   trunk/fsvs/src/resolve.c
   trunk/fsvs/src/resolve.h
Modified:
   trunk/ (props changed)
   trunk/fsvs/CHANGES
   trunk/fsvs/src/ac_list.c
   trunk/fsvs/src/commit.c
   trunk/fsvs/src/doc.g-c
   trunk/fsvs/src/dox/options.dox
   trunk/fsvs/src/dox/statii.dox
   trunk/fsvs/src/global.h
   trunk/fsvs/src/revert.c
   trunk/fsvs/src/status.c
   trunk/fsvs/src/waa.h
   trunk/fsvs/tests/053_conflicts

Log:
New "resolve" action.




Modified: trunk/fsvs/CHANGES
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/CHANGES​?view=diff&rev=1​554&p1=trunk/fsv​s/CHANGES&p2=tru​nk/fsvs/CHANGES&​r1=1553&r2=1554
====================​====================​====================​==================
--- trunk/fsvs/CHANGES (original)
+++ trunk/fsvs/CHANGES 2008-03-18 23:41:44-0700
@@ -1,6 +1,7 @@
 Changes since 1.1.13
 - New option for conflict handling; allows "stop" (historical default),
     "local", "remote", "both" or "merge".
+- New "resolve" action.
 - Verbose "urls dump".
 - Small fixes and cleanups.
 - Bugfix - option "filter" wasn't taken from config files.

Modified: trunk/fsvs/src/ac_list.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/ac_​list.c?view=diff​&rev=1554&p1=tru​nk/fsvs/src/ac_list.​c&p2=trunk/fsvs/​src/ac_list.c&r1​=1553&r2=1554
====================​====================​====================​==================
--- trunk/fsvs/src/ac_list.c (original)
+++ trunk/fsvs/src/ac_list.c 2008-03-18 23:41:44-0700
@@ -24,6 +24,7 @@
 #include "info.h"
 #include "revert.h"
 #include "remote.h"
+#include "resolve.h"
 #include "build.h"
 
 
@@ -46,6 +47,7 @@
             *acl_cp[] = { "copy", "move", "cp", "mv", NULL },
             *acl_unvers[] = { "unversion", NULL },
             *acl_log[] = { "log", NULL },
+ *acl_resolv[] = { "resolve", NULL },
             *acl_checko[] = { "checkout", "co", NULL },
             *acl_sync_r[] = { "sync-repos", NULL },
             *acl_revert[] = { "revert", "undo", NULL },
@@ -91,6 +93,7 @@
     ACT(ignore, ign__work, NULL, NULL),
     ACT(copyfr, cm__detect, st__progress, st__progress_uninit),
     ACT( cp, cm__work, NULL, NULL),
+ ACT(resolv, res__work, res__action, NULL, .is_compare=1),
     ACT( log, log__work, NULL, NULL),
     ACT(checko, co__work, NULL, NULL, .needs_decoder=1),
     ACT( build, bld__work, st__status, NULL),

Modified: trunk/fsvs/src/commit.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/com​mit.c?view=diff&​rev=1554&p1=trun​k/fsvs/src/commit.c​&p2=trunk/fsvs/sr​c/commit.c&r1=15​53&r2=1554
====================​====================​====================​==================
--- trunk/fsvs/src/commit.c (original)
+++ trunk/fsvs/src/commit.c 2008-03-18 23:41:44-0700
@@ -166,6 +166,12 @@
 int ci__action(struct estat *sts,
         char *path)
 {
+ int status;
+
+
+ STOPIF_CODE_ERR( sts->flags & RF_CONFLICT, EBUSY,
+ "!The entry \"%s\" is still marked as conflict.", path);
+
     if (sts->entry_status ||
             (sts->flags & (RF_ADD | RF_UNVERSION | RF_PUSHPROPS)) )
     {
@@ -179,7 +185,10 @@
         }
     }
 
- return st__progress(sts, path);
+ STOPIF( st__progress(sts, path), NULL);
+
+ex:
+ return status;
 }
 
 

Modified: trunk/fsvs/src/doc.g-c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/doc​.g-c?view=diff&r​ev=1554&p1=trunk​/fsvs/src/doc.g-c​&p2=trunk/fsvs/src/​doc.g-c&r1=1553​&r2=1554
====================​====================​====================​==================
--- trunk/fsvs/src/doc.g-c (original)
+++ trunk/fsvs/src/doc.g-c 2008-03-18 23:41:44-0700
@@ -3,6 +3,10 @@
  * */
 
 
+const char hlp_resolv[]=" fsvs resolve PATH [PATH...]\n"
+ "\n"
+ "\n";
+
 const char hlp_add[]=" fsvs add PATH [PATH...]\n"
   "\n"
   " With this command you can explicitly define entries to be versioned,\n"

Modified: trunk/fsvs/src/dox/options.dox
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/dox​/options.dox?view=di​ff&rev=1554&​p1=trunk/fsvs/src/do​x/options.dox&p2​=trunk/fsvs/src/dox/​options.dox&r1=1​553&r2=1554
====================​====================​====================​==================
--- trunk/fsvs/src/dox/options.dox (original)
+++ trunk/fsvs/src/dox/options.dox 2008-03-18 23:41:44-0700
@@ -389,9 +389,13 @@
 If you start an update, but one of the entries that was changed in the
 repository is changed locally too, you get a conflict.
 
+
 There are some ways to resolve a conflict:<UL>
+
 <LI>\c local - Just take the local entry, ignore the repository.
+
 <LI>\c remote - Overwrite any local change with the remote version.
+
 <LI>\c both - Keep the local modifications in the file renamed to
 <tt><i>f​ilename</i>.mi​ne</tt>, and save the repository version as
 <tt><i>f​ilename</i>.r​<i>XXX</i​></tt>, ie. put the revision number after
@@ -399,6 +403,16 @@
 
 These files will be seen as \c New; the conflict must be solved manually,
 and the resolution made known to FSVS via \ref resolve.
+
+\note As there's no known \e good version after this renaming, a zero byte
+file gets created. \n
+Any \ref resolve "resolve" or \ref revert "revert" command would make that
+current, and the changes that are kept in <tt><i>f​ilename</i>.mi​ne</tt>
+would be lost! \n
+You could only \ref revert to the last repository version, ie. the data of
+<tt><i>​filename</i>.r​<i>XXX</i​></tt>.
+
+
 <LI>\c merge - Call the program \c merge with the common ancestor, the
 local and the remote version.
 
@@ -408,7 +422,9 @@
 resolve.
 </ul>
 
-\note The command \c resolve is not implemented yet.
+\note As in the subversion command line client \c svn the auxiliary files
+are seen as new, although that might change in the future (so that they
+automatically get ignored).
 
 
 \section o_merge Options regarding the "merge" programm

Modified: trunk/fsvs/src/dox/statii.dox
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/dox​/statii.dox?view=dif​f&rev=1554&p​1=trunk/fsvs/src/dox​/statii.dox&p2=t​runk/fsvs/src/dox/st​atii.dox&r1=1553​&r2=1554
====================​====================​====================​==================
--- trunk/fsvs/src/dox/statii.dox (original)
+++ trunk/fsvs/src/dox/statii.dox 2008-03-18 23:41:44-0700
@@ -52,7 +52,11 @@
 
             Unversioned [label="To-be-\nunversioned"];
 
- CopiedC [label="Copied,\nchanged"];
+ {
+ rank=same;
+ Conflicted;
+ CopiedC [label="Copied,\nchanged"];
+ }
 
 
             // --------------- Commands
@@ -64,6 +68,14 @@
             Committed -> Unversioned [label="unversion", URL="\ref unversion"];
 
             {
+ edge [ label="update", URL="\ref update"];
+ Committed -> Committed;
+ Changed -> Conflicted;
+ }
+
+ Conflicted -> Changed [label="resolve", URL="\ref resolve"];
+
+ {
                 edge [ color=green, URL="\ref commit",
                   tooltip="commit"];
                 Added -> Committed;
@@ -74,7 +86,7 @@
 
                 Unversioned -> New [
                     label="commit;\nremoved from\nrepository;\nlocally kept,\nbut forgotten."];
- Deleted -> Not_existing [
+ Deleted:w -> Not_existing [
                     label="commit;\nremoved from\nrepository\nand local data."];
             }
 
@@ -90,6 +102,7 @@
                 Deleted -> Committed;
                 Added -> New;
                 Unversioned -> Committed;
+ Conflicted -> Committed;
             }
 
 

Modified: trunk/fsvs/src/global.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/glo​bal.h?view=diff&​rev=1554&p1=trun​k/fsvs/src/global.h​&p2=trunk/fsvs/sr​c/global.h&r1=15​53&r2=1554
====================​====================​====================​==================
--- trunk/fsvs/src/global.h (original)
+++ trunk/fsvs/src/global.h 2008-03-18 23:41:44-0700
@@ -461,7 +461,7 @@
 
 /** Which of the flags above should be stored in the WAA. */
 #define RF___SAVE_MASK (RF_UNVERSION | RF_ADD | RF_CHECK | \
- RF_COPY_BASE | RF_COPY_SUB | RF_PUSHPROPS)
+ RF_COPY_BASE | RF_COPY_SUB | RF_PUSHPROPS | RF_CONFLICT)
 /** Mask for commit-relevant flags.
  * An entry with \c RF_COPY_BASE must (per definition) marked as \c RF_ADD;
  * and RF_PUSHPROPS gets folded into FS_PROPERTIES. */

Added: trunk/fsvs/src/resolve.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/res​olve.c?view=auto​&rev=1554
====================​====================​====================​==================
--- (empty file)
+++ trunk/fsvs/src/resolve.c 2008-03-18 23:41:44-0700
@@ -0,0 +1,214 @@
+/******************​********************​********************​**************
+ * Copyright (C) 2008 Philipp Marek.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ ********************​********************​********************​************/
+
+#include <fcntl.h>
+#include <sys/uio.h>
+#include <sys/mman.h>
+
+
+#include "global.h"
+#include "est_ops.h"
+#include "helper.h"
+#include "url.h"
+#include "status.h"
+#include "resolve.h"
+#include "waa.h"
+#include "hash_ops.h"
+#include "actions.h"
+
+
+/** \file
+ * The \ref resolve command source file.
+ *
+ * */
+
+/** \addtogroup cmds
+ *
+ * \section resolve
+ *
+ * \code
+ * fsvs resolve PATH [PATH...]
+ * \endcode
+ *
+ * When FSVS tries to update local files which have been changed, a
+ * conflict might occur. (For various ways of handling these please see the
+ * \ref o_conflict "conflict" option.)
+ *
+ * This command lets you mark such conflicts as resolved.
+ */
+
+
+/** -.
+ *
+ * The conflict flag \b must be set by this function, so that it knows
+ * whether it has to purge any (wrongly) pre-existing \ref cflct file or to
+ * just append.
+ * */
+int res__mark_conflict(struct estat *sts, ...)
+{
+ int status;
+ char *filename;
+ va_list va;
+ int filehdl;
+ int len;
+ struct iovec io[2] = { { 0 }, { .iov_base="\n", .iov_len=1 } };
+
+
+ status=0;
+ va_start(va, sts);
+ filehdl=-1;
+
+ STOPIF( ops__build_path(&filename, sts), NULL);
+ STOPIF( waa__open_byext(filename, WAA__CONFLICT_EXT,
+ (sts->flags & RF_CONFLICT) ? WAA__APPEND : WAA__WRITE,
+ & filehdl), NULL );
+
+ while ( (filename =va_arg(va, char*)) )
+ {
+ len=strlen(filename);
+
+ io[0].iov_base=filename;
+ /* Take the \0 */
+ io[0].iov_len=len+1;
+ STOPIF_CODE_ERR( writev(filehdl, io, sizeof(io)/sizeof(io[0])) != len+1+1,
+ errno, "Writing the conflict list for %s", filename);
+ }
+
+ sts->flags |= RF_CONFLICT;
+
+ex:
+ if (filehdl != -1)
+ {
+ len=waa__close(filehdl, status);
+ filehdl=-1;
+ STOPIF_CODE_ERR( !status && len==-1, errno,
+ "Closing the conflict list for %s", filename);
+ }
+ return status;
+}
+
+
+/** -.
+ * */
+int res__action(struct estat *sts, char *path)
+{
+ int status;
+
+ status=0;
+ if (sts->flags & RF_ISNEW)
+ {
+ /* We're not going recursively, so there's no need to process
+ * sub-entries. */
+ sts->entry_type=FT_IGNORE;
+ }
+ else
+ {
+ if ( sts->flags & RF_CONFLICT )
+ STOPIF( res__remove_aux_files(sts), NULL);
+ STOPIF( st__status(sts, path), NULL);
+ }
+
+ex:
+ return status;
+}
+
+
+/** -.
+ * */
+int res__remove_aux_files(struct estat *sts)
+{
+ int status;
+ char *filename, *to_remove;
+ int filehdl;
+ int len;
+ char *mapped;
+ struct sstat_t st;
+
+
+ status=0;
+ filehdl=-1;
+ mapped=MAP_FAILED;
+
+ STOPIF( ops__build_path(&filename, sts), NULL);
+ STOPIF( waa__open_byext(filename, WAA__CONFLICT_EXT,
+ WAA__READ, &filehdl), NULL );
+
+ STOPIF( hlp__fstat( filehdl, &st), NULL);
+
+ mapped=mmap(NULL, st.size, PROT_READ, MAP_SHARED, filehdl, 0);
+ STOPIF_CODE_ERR( mapped==MAP_FAILED, errno,
+ "Can't map handle %d", filehdl);
+
+ to_remove=mapped;
+ while ( to_remove - mapped != st.size )
+ {
+ BUG_ON(to_remove - mapped > st.size);
+
+ if (unlink(to_remove) == -1)
+ STOPIF_CODE_ERR( errno != ENOENT, errno,
+ "Cannot remove conflict file \"%s\" (from \"%s\")",
+ to_remove, filename);
+
+ to_remove += strlen(to_remove)+1;
+ if (*to_remove == '\n') to_remove++;
+ }
+
+ sts->flags &= ~RF_CONFLICT;
+
+ STOPIF( waa__delete_byext(filename, WAA__CONFLICT_EXT, 0), NULL);
+
+ex:
+ if (filehdl != -1)
+ {
+ len=waa__close(filehdl, status);
+ filehdl=-1;
+ STOPIF_CODE_ERR( !status && len==-1, errno,
+ "Closing the conflict list for %s", filename);
+ }
+
+ if (mapped != MAP_FAILED)
+ STOPIF_CODE_ERR( munmap(mapped, st.size) == -1, errno,
+ "Cannot munmap()");
+
+ return status;
+}
+
+
+/** -.
+ * */
+int res__work(struct estat *root, int argc, char *argv[])
+{
+ int status;
+ char **normalized;
+
+
+ status=0;
+ /* Don't recurse. */
+ opt_recursive=-1;
+ only_check_status=1;
+
+ STOPIF( waa__find_common_base(argc, argv, &normalized), NULL);
+ if (argc == 0) ac__Usage_this();
+
+ STOPIF( url__load_nonempty_list(NULL, 0), NULL);
+
+/* Maybe we should add a flag saying that we don't want unknown entries,
+ * like it can easily happen with "fsvs resolve *".
+ * But then we'd get an error, and this is not so user-friendly like just
+ * ignoring these entries in res__action(). */
+ status=waa__read_or_​build_tree(root, argc, normalized, argv, NULL, 1);
+ if (status == ENOENT)
+ STOPIF(status, "!No data about current entries is available.");
+ STOPIF(status, NULL);
+
+ STOPIF( waa__output_tree(root), NULL);
+
+ex:
+ return status;
+}
+

Added: trunk/fsvs/src/resolve.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/res​olve.h?view=auto​&rev=1554
====================​====================​====================​==================
--- (empty file)
+++ trunk/fsvs/src/resolve.h 2008-03-18 23:41:44-0700
@@ -0,0 +1,32 @@
+/******************​********************​********************​**************
+ * Copyright (C) 2008 Philipp Marek.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ ********************​********************​********************​************/
+
+#ifndef __RESOLVE_H__
+#define __RESOLVE_H__
+
+/** \file
+ * \ref resolve action header file. */
+
+#include "global.h"
+#include "actions.h"
+
+/** This function takes a \c NULL terminated list of filenames, and appends
+ * it to the conflict list of the given \a sts. */
+int res__mark_conflict(struct estat *sts, ...) __attribute((sentinel));
+
+/** Removes all stored files. */
+int res__remove_aux_files(struct estat *sts);
+
+/** Resolve command main function. */
+work_t res__work;
+
+/** Resolve command action function. */
+action_t res__action;
+
+#endif
+

Modified: trunk/fsvs/src/revert.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/rev​ert.c?view=diff&​rev=1554&p1=trun​k/fsvs/src/revert.c​&p2=trunk/fsvs/sr​c/revert.c&r1=15​53&r2=1554
====================​====================​====================​==================
--- trunk/fsvs/src/revert.c (original)
+++ trunk/fsvs/src/revert.c 2008-03-18 23:41:44-0700
@@ -17,6 +17,7 @@
 #include "est_ops.h"
 #include "racallback.h"
 #include "warnings.h"
+#include "resolve.h"
 #include "checksum.h"
 #include "props.h"
 #include "cache.h"
@@ -483,14 +484,16 @@
     }
     else
     {
- DEBUGP("non-zero return");
+ DEBUGP("non-zero return");
         STOPIF_CODE_ERR( WEXITSTATUS(retval) != 1, EINVAL,
                 "\"%s\" exited with error code %d",
                 opt__get_string(OPT_​_MERGE_PRG),
                 WEXITSTATUS(retval));
 
+ STOPIF( res__mark_conflict(sts,
+ file1, file2, common, NULL), NULL);
+
         /* Means merge conflicts, but no error. */
- sts->flags |= RF_CONFLICT;
     }
 
     /* As we've just changed the text, set the current mtime. */
@@ -607,6 +610,9 @@
         /* We know where to get that from. */
         DEBUGP("have an URL for %s", path);
 
+ if ( sts->flags & RF_CONFLICT )
+ STOPIF( res__remove_aux_files(sts), NULL);
+
         /* If not seen as changed, but target is BASE, we don't need to do
          * anything. */
         if (!opt_target_revisions_given &&
@@ -976,12 +982,34 @@
 
                         /* If we're updating and already have a conflict, we don't
                          * merge again. */
- if (opt__get_int(OPT__CONFLICT) == CONFLICT_MERGE)
+ if (sts->flags & RF_CONFLICT)
+ {
+ printf("\"%s\" already marked as conflict.\n", fn);
+ STOPIF( res__mark_conflict(sts,
+ unique_name_mine, unique_name_remote, NULL), NULL);
+ }
+ else if (opt__get_int(OPT__CONFLICT) == CONFLICT_BOTH)
+ {
+ STOPIF( res__mark_conflict(sts,
+ unique_name_mine, unique_name_remote, NULL), NULL);
+
+ /* Create an empty file,
+ * a) to remind the user, and
+ * b) to avoid a "Deleted" status. */
+ j=creat(fn, 0777);
+ if (j != -1) j=close(j);
+
+ STOPIF_CODE_ERR(j == -1, errno,
+ "Error creating \"%s\"", fn);
+
+ /* up__set_meta_data() does an lstat(), but we want the
+ * original values. */
+ st=sts->st;
+ STOPIF( up__set_meta_data(sts, fn), NULL);
+ sts->st=st;
+ }
+ else if (opt__get_int(OPT__CONFLICT) == CONFLICT_MERGE)
                         {
- if (sts->flags & RF_CONFLICT)
- printf("\"%s\" already marked as conflict.\n",
- fn);
- else
                             {
                                 STOPIF( rev__get_file(sts, sts->old_rev, NULL,
                                             NULL, NULL, subpool),
@@ -1000,8 +1028,6 @@
                                             unique_name_remote), NULL);
                             }
                         }
- else if (opt__get_int(OPT__CONFLICT) == CONFLICT_BOTH)
- sts->flags |= RF_CONFLICT;
                         else
                             BUG("why a conflict?");
                     }

Modified: trunk/fsvs/src/status.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/sta​tus.c?view=diff&​rev=1554&p1=trun​k/fsvs/src/status.c​&p2=trunk/fsvs/sr​c/status.c&r1=15​53&r2=1554
====================​====================​====================​==================
--- trunk/fsvs/src/status.c (original)
+++ trunk/fsvs/src/status.c 2008-03-18 23:41:44-0700
@@ -79,6 +79,7 @@
  * changes, ie. the entries filesystem meta-data is unchanged.
  * - A \c '+' is printed for files with a copy-from history; to see the URL
  * of the copyfrom source, use \c -v twice.
+ * - A \c 'x' signifies a conflict.
  *
  *
  * Here's a table with the characters and their positions:
@@ -86,7 +87,7 @@
  * Without -v With -v
  * .... ......
  * NmC? NtpPC?
- * DP ! D !
+ * DPx! D x!
  * R + R +
  * d d
  * n n
@@ -227,7 +228,8 @@
 
           st___meta_string(status_bits, flags),
 
- status_bits & FS_CHANGED ? 'C' : '.',
+ flags & RF_CONFLICT ? 'x' :
+ status_bits & FS_CHANGED ? 'C' : '.',
 
                     flags & RF___IS_COPY ? '+' :
                     status_bits & FS_LIKELY ? '?' :
@@ -580,6 +582,7 @@
         BIT_INFO( RF_CHECK, "check"),
         BIT_INFO( RF_COPY_BASE, "copy_base"),
         BIT_INFO( RF_COPY_SUB, "copy_sub"),
+ BIT_INFO( RF_CONFLICT, "conflict"),
         BIT_INFO( RF_PUSHPROPS, "push_props"),
     };
 

Modified: trunk/fsvs/src/waa.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/waa​.h?view=diff&rev​=1554&p1=trunk/f​svs/src/waa.h&p2​=trunk/fsvs/src/waa.​h&r1=1553&r2​=1554
====================​====================​====================​==================
--- trunk/fsvs/src/waa.h (original)
+++ trunk/fsvs/src/waa.h 2008-03-18 23:41:44-0700
@@ -141,6 +141,9 @@
 /** \anchor prop List of other properties.
  * These are properties not converted to meta-data. */
 #define WAA__PROP_EXT "prop"
+/** \anchor cflct List of other conflict files.
+ * Defined as <tt>filename\​\0\\nfilename\\​0\\n...</tt>​ */
+#define WAA__CONFLICT_EXT "cflct"
 /** @} */
 
 /** \anchor ino
@@ -172,12 +175,11 @@
 /** @} */
 
 
-
 /* this should be optimized into a constant.
  * verified for gcc (debian 4.0.0-7ubuntu2) */
 #define WAA__MAX_EXT_LENGTH max( \
         max( max(strlen(WAA__DIR_EXT), strlen(WAA__PROP_EXT) ), \
- strlen(WAA__FILE_MD5s_EXT) ), \
+ strlen(WAA__FILE_MD5s_EXT) ), \
         max(strlen(WAA__IGNORE_EXT), strlen(WAA__URLLIST_EXT) ) \
     )
 

Modified: trunk/fsvs/tests/053_conflicts
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/tests/0​53_conflicts?view=di​ff&rev=1554&​p1=trunk/fsvs/tests/​053_conflicts&p2​=trunk/fsvs/tests/05​3_conflicts&r1=1​553&r2=1554
====================​====================​====================​==================
--- trunk/fsvs/tests/053_conflicts (original)
+++ trunk/fsvs/tests/053_conflicts 2008-03-18 23:41:44-0700
@@ -12,13 +12,13 @@
 # A list of numbers
 seq 1 20 > common_ancestor
 # Lines *2 gets changed
-perl -pe 's/2$/2changed/' < common_ancestor > repository
+perl -pe 's/2$/2changed-repos/' < common_ancestor > repository
 # Now change line 7.
-perl -pe 's/^7$/7changed/' < common_ancestor > locally_changed
+perl -pe 's/^7$/7local/' < common_ancestor > locally_changed
 # What the merged file should look like
 merge -A -p locally_changed common_ancestor repository > merged_ok
 # Another local data, with conflict
-perl -pe 's/^2$/2 is changed, too/' < common_ancestor > will_conflict
+perl -pe 's/^2$/2 is changed=conflict/' < common_ancestor > will_conflict
 # Output of the merge conflict can be done only when we know the revision
 # numbers; these get encoded in the filenames.
 touch merged_conflict
@@ -67,6 +67,10 @@
 else
   $SUCCESS "Stop on conflict=stop"
 fi
+if $BINdflt st -v $target | grep "^....x. "
+then
+ $ERROR "Marked as conflict on conflict=stop?"
+fi
 
 
 if $BINq up -o conflict=local > $logfile 2>&1
@@ -84,10 +88,15 @@
   $ERROR "conflict=local doesn't work"
 fi
 
+if $BINdflt st -v $target | grep "^....x. "
+then
+ $ERROR "Marked as conflict on conflict=local?"
+fi
+
 if [[ x`$BINq st $target` != x ]]
 then
     $BINq st $target
- $ERROR "unexpected status output - should be empty."
+ $ERROR "unexpected status output on conflict=local - should be empty."
 fi
 
 
@@ -113,6 +122,11 @@
   $ERROR "conflict=repository doesn't work"
 fi
 
+if $BINdflt st -v $target | grep "^...x. "
+then
+ $ERROR "Marked as conflict on conflict=repos?"
+fi
+
 
 # Goto old revision. There's no conflict now, as we took the committed
 # version.
@@ -134,7 +148,24 @@
 then
     $ERROR "conflict=both: wrong data for $target.r$rev_new."
 fi
-$SUCCESS "conflict=both works."
+
+if $BINdflt st -v $target | grep "^....x. "
+then
+ $SUCCESS "conflict=both works."
+else
+ $ERROR "No conflict on conflict=both?"
+fi
+
+
+# Revert should leave only a single file.
+$BINq revert $target
+if [[ `ls -dla $target* | wc -l` -eq 1 ]]
+then
+ $SUCCESS "aux files removed after revert."
+else
+ ls -dla $target*
+ $ERROR "unexpected auxillary files after revert."
+fi
 
 
 rm $target*
@@ -192,4 +223,54 @@
 fi
 
 
-# Check CONFLICT flag
+if $BINdflt st -v $target | grep "^....x. "
+then
+ $SUCCESS "conflict marker set."
+else
+ $ERROR "No conflict on mis-merge?"
+fi
+
+if $BINdflt ci $target -m 1
+then
+ $ERROR "shouldn't commit a conflicted file!"
+else
+ $SUCCESS "doesn't commit a conflicted file"
+fi
+
+
+# resolve should leave only a single file, and process only known.
+$BINq resolve *
+if [[ `ls -dla $target* | wc -l` -eq 1 ]]
+then
+ $SUCCESS "aux files removed after revert (2)."
+else
+ ls -dla $target*
+ $ERROR "unexpected auxillary files after revert (2)."
+fi
+
+# After resolve only $target should be seen - not any other files.
+# With just "status" we'd get a line for ".", too - which we don't want.
+$BINdflt st * > $logfile
+if [[ `grep '^N' < $logfile | wc -l` -ne 6 ]]
+then
+ cat $logfile
+ $ERROR "resolve takes unknown files, too"
+fi
+if [[ `grep -v '^N' < $logfile` == ".mC."*"$target" ]]
+then
+ $SUCCESS "resolve takes only the known files."
+else
+ cat $logfile
+ $ERROR "Wrong status after resolve"
+fi
+
+
+
+if $BINdflt ci $target -m 1
+then
+ $SUCCESS "Can commit after revert."
+else
+ $ERROR "Can't commit?"
+fi
+
+

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

Messages

Show all messages in topic

svn commit: r1554 - trunk: . fsvs fsvs/src fsvs/src/dox fsvs/tests pmarek P.Marek 2008-03-18 23:41:45 PDT
Messages per page: