monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] any_path, bookkeeping_path, file_path


From: Stephen Leake
Subject: [Monotone-devel] any_path, bookkeeping_path, file_path
Date: Mon, 01 Sep 2008 15:06:08 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]