In specifying conflict resolutions, the user can specify a file that
contains the desired content.

I'd like to allow that file to either be in the workspace, or in the
bookkeeping area (or anywhere else, for that matter). That gives the
user maximum flexibility in designing a workflow.

However, I don't see how to do that nicely. There are two problems;
converting a std::string to an arbitrary path, and storing external
file names in basic-io format.

I'm just discovering this now, because all my tests so far have had
the user file in the workspace, but for the real Emacs DVC process, it
makes more sense to have it in the bookkeeping area.

First, I can store a std::string in the conflict resolution data. But
when it comes time to read that file, I had to do this:

  if (bookkeeping_path::external_string_is_bookkeeping_path
      (utf8(conflict.resolution.second)))
    {
      bookkeeping_path p(conflict.resolution.second);
      read_data(p, result_raw_data);
    }
  else
    {
      file_path p(file_path_external(utf8(conflict.resolution.second)));
      read_data(p, result_raw_data);
    }

because there is no way to construct an 'any_path' object from a
string.

Second, the basic-io format assumes internal representation of file
paths: push_file_pair outputs file_path.as_internal().

So I'm using push_str_pair instead, with the raw user-supplied file
name, and handling the conversion to any_path only when it's actually
needed, as above. I'm not sure that's acceptable.

-- 
-- Stephe


_______________________________________________
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to