浏览代码

some upstream vendor fixes since monotone 0.36

Ralf S. Engelschall 18 年之前
父节点
当前提交
64e068b1bc
共有 2 个文件被更改,包括 124 次插入1 次删除
  1. 121 0
      monotone/monotone.patch
  2. 3 1
      monotone/monotone.spec

+ 121 - 0
monotone/monotone.patch

@@ -0,0 +1,121 @@
+some upstream vendor fixes since monotone 0.36
+
+Index: automate.cc
+--- automate.cc.orig	2007-08-03 08:15:05 +0200
++++ automate.cc	2007-08-08 11:03:02 +0200
+@@ -69,12 +69,19 @@
+   N(args.size() < 2,
+     F("wrong argument count"));
+ 
+-  if (args.size() ==1 ) {
++  system_path database_option;
++  branch_name branch_option;
++  rsa_keypair_id key_option;
++  system_path keydir_option;
++  app.work.get_ws_options(database_option, branch_option,
++                          key_option, keydir_option);
++
++  if (args.size() == 1 ) {
+     // branchname was explicitly given, use that
+-    app.opts.branchname = branch_name(idx(args, 0)());
++    branch_option = branch_name(idx(args, 0)());
+   }
+   set<revision_id> heads;
+-  app.get_project().get_branch_heads(app.opts.branchname, heads);
++  app.get_project().get_branch_heads(branch_option, heads);
+   for (set<revision_id>::const_iterator i = heads.begin(); i != heads.end(); ++i)
+     output << (*i).inner()() << '\n';
+ }
+Index: cmd_ws_commit.cc
+--- cmd_ws_commit.cc.orig	2007-08-03 08:15:09 +0200
++++ cmd_ws_commit.cc	2007-08-08 11:03:02 +0200
+@@ -444,7 +444,8 @@
+ 
+   app.require_workspace();
+ 
+-  file_path dst_path = file_path_external(args.back());
++  utf8 dstr = args.back();
++  file_path dst_path = file_path_external(dstr);
+ 
+   set<file_path> src_paths;
+   for (size_t i = 0; i < args.size()-1; i++)
+@@ -452,6 +453,15 @@
+       file_path s = file_path_external(idx(args, i));
+       src_paths.insert(s);
+     }
++
++  //this catches the case where the user specifies a directory 'by convention'
++  //that doesn't exist.  the code in perform_rename already handles the proper
++  //cases for more than one source item.
++  if (src_paths.size() == 1 && dstr()[dstr().size() -1] == '/')
++    if (get_path_status(*src_paths.begin()) != path::directory)
++	    N(get_path_status(dst_path) == path::directory,
++	      F(_("The specified target directory %s/ doesn't exist.")) % dst_path);
++
+   app.work.perform_rename(src_paths, dst_path, app.opts.bookkeep_only);
+ }
+ 
+Index: work.cc
+--- work.cc.orig	2007-08-03 08:15:16 +0200
++++ work.cc	2007-08-08 11:03:02 +0200
+@@ -1435,9 +1435,7 @@
+     {
+       // "rename SRC DST" case
+       file_path const & src = *srcs.begin();
+-
+-      N(!directory_exists(dst),
+-        F("destination dir %s/ is not versioned (perhaps add it?)") % dst);
++      file_path dpath = dst;
+ 
+       N(!src.empty(),
+         F("cannot rename the workspace root (try '%s pivot_root' instead)")
+@@ -1445,20 +1443,30 @@
+       N(new_roster.has_node(src),
+         F("source file %s is not versioned") % src);
+ 
+-      renames.insert(make_pair(src, dst));
+-      add_parent_dirs(dst, new_roster, nis, db, lua);
++      //this allows the 'magic add' of a non-versioned directory to happen in
++      //all cases.  previously, mtn mv fileA dir/ woudl fail if dir/ wasn't
++      //versioned whereas mtn mv fileA dir/fileA would add dir/ if necessary
++      //and then reparent fileA.
++      if (get_path_status(dst) == path::directory)
++        dpath = dst / src.basename();
++      else
++        {
++          //this handles the case where:
++          // touch foo
++          // mtn mv foo bar/foo where bar doesn't exist
++          file_path parent = dst.dirname();
++	        N(get_path_status(parent) == path::directory,
++	          F("destination path's parent directory %s/ doesn't exist") % parent);
++        }
++
++      renames.insert(make_pair(src, dpath));
++      add_parent_dirs(dpath, new_roster, nis, db, lua);
+     }
+   else
+     {
+       // "rename SRC1 [SRC2 ...] DSTDIR" case
+-      N(new_roster.has_node(dst),
+-        F("destination dir %s/ is not versioned (perhaps add it?)") % dst);
+-
+-      N(is_dir_t(new_roster.get_node(dst)),
+-        (srcs.size() > 1
+-        ? F("destination %s is a file, not a directory")
+-        : F("destination %s already exists in the workspace manifest"))
+-        % dst);
++      N(get_path_status(dst) == path::directory,
++        F("destination %s/ is not a directory") % dst);
+ 
+       for (set<file_path>::const_iterator i = srcs.begin();
+            i != srcs.end(); i++)
+@@ -1474,6 +1482,8 @@
+             F("destination %s already exists in the workspace manifest") % d);
+ 
+           renames.insert(make_pair(*i, d));
++
++          add_parent_dirs(d, new_roster, nis, db, lua);
+         }
+     }
+ 

+ 3 - 1
monotone/monotone.spec

@@ -33,12 +33,13 @@ Class:        EVAL
 Group:        SCM
 License:      GPL
 Version:      0.36
-Release:      20070803
+Release:      20070808
 
 #   list of sources
 Source0:      http://monotone.ca/downloads/%{version}/monotone-%{version}.tar.gz
 Source1:      rc.monotone
 Source3:      monotone-setup.sh
+Patch0:       monotone.patch
 
 #   build information
 Prefix:       %{l_prefix}
@@ -70,6 +71,7 @@ AutoReqProv:  no
 
 %prep
     %setup -q
+    %patch -p0
 
 %build
     #   configure program