[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[RFC] Updating update_editor.c:preserve_pre_merge_files() for WC-NG

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Fri, 18 Jun 2010 16:00:49 +0100

I've been looking at the part of "svn update" where it generates a text
conflict and stores the conflict result as three user-visible files
(foo.r1, foo.r2, foo.mine).

Comments (and reassurance that I'm sane, if you will) please.

ASCII call graph:

                        merge_file_changed()
                            |
                            |
                            |
                        svn_wc_merge4()
                            |
                            |
    close_file() |
        | |
    merge_file() |
          | |
          | |
        svn_wc__internal_merge()
            |
        merge_text_file()
            |
        maybe_resolve_conflicts()
            |
            |
        preserve_pre_merge_files()

CURRENTLY:

  Construct three unique user-visible file names, from
  TARGET_ABSPATH and *_LABEL inputs.

  Create three user-visible files as empty files,
  so we can reserve the chosen names.

  Copy {LEFT,RIGHT}_ABSPATH to adm tmp dir, from wherever
    they were, so loggy funcs can find them.
    ### Bug: del_on_pool_cleanup = scratch_pool: too soon!

  Translate TARGET_ABSPATH to Repo-Normal Form, using its
    current props, and store into adm tmp dir.

  WQ += loggy_translated_file(LEFT-TMP -> LEFT-VISIBLE)
  WQ += loggy_translated_file(RIGHT-TMP -> RIGHT-VISIBLE)
  WQ += loggy_translated_file(TARGET-TMP -> TARGET-VISIBLE)
    These translations will use TARGET's props as found in
    the DB at the time.

  WQ += set_text_conflict_markers(LEFT,RIGHT,TARGET)
    But this is a DB op that should be done outside.

PROBLEMS:

  Function depends on DB being updated after function call
  but before the translated_file WQ items are executed.

  Function schedules an update of the DB (WORKING_NODE row
  for TARGET_ABSPATH) from within a WQ item.

  Bug: see ### above.

  LEFT and RIGHT input files are obtained by (multiple)
  copying; they should be able to come straight from the
  pristine store in most cases.

PROPOSED:

  Inputs:
    - TARGET_ABSPATH (versioned file, as before)
    - {LEFT,RIGHT}_SHA1 (of stored pristine texts)
    - {LEFT,RIGHT,TARGET}_LABEL (as before)
    - the PROPS to be used for later translation.

  Needs:
    - a WQ item that translates from a specified pristine
      text to a specified path using specified props.
      (This way, the WQ items don't depend on when DB gets
      updated, and TARGET isn't treated as special in
      providing props at WQ execution time.)

  Construct three user-visible file names (as before).
 
  Translate TARGET_ABSPATH to Repo-Normal Form, using its
  current props, and store this in the Pristine Store, and
  remember its TARGET_SHA1.

  for x in LEFT, RIGHT, TARGET:
    x_path = user-visible-path[x]
    WQ += translate-from-pristine(x_SHA1, x_path, PROPS)

  Outputs:
    - The three WQ items.
    - The three SHA-1's and user-visible filenames (so the
      caller can update the DB row of TARGET_ABSPATH at
      the same time as adding these WQ items to the WQ).

- Julian
Received on 2010-06-18 17:01:30 CEST

This is an archived mail posted to the Subversion Dev mailing list.