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

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

From: Greg Stein <gstein_at_gmail.com>
Date: Fri, 18 Jun 2010 17:34:07 -0400

Perfect,

with one potential caveat: not sure if you have PROPS at the time of
work item creation. ie. the props that *will* exist at wq run. IOW,
where does "update the props in the DB" fall with respect to the
algorithm below? Should the props be unavailable, then you would need
to change the parameter to VERSIONED_ABSPATH (there is precedent for
this param name, to mean "the versioned item specified by this path",
rather than specifically referring to a location in the local
filesystem).

If the new-props *are* available, then I would call your suggestion Ideal.

Cheers,
-g

On Fri, Jun 18, 2010 at 11:00, Julian Foad <julian.foad_at_wandisco.com> wrote:
> 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 23:34:47 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.