Added: subversion/site/staging/blog/2013-06-28-foreign-repository-copies.html
URL:
http://svn.apache.org/viewvc/subversion/site/staging/blog/2013-06-28-foreign-repository-copies.html?rev=1908741&view=auto
==============================================================================
--- subversion/site/staging/blog/2013-06-28-foreign-repository-copies.html
(added)
+++ subversion/site/staging/blog/2013-06-28-foreign-repository-copies.html Sun
Mar 26 20:17:15 2023
@@ -0,0 +1,136 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<meta http-equiv="x-ua-compatible" content="ie=edge">
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Apache Subversion Mergeinfo - Understanding the internals</title>
+<meta name="description" content="Subversion 1.8 server dictated configuration
part 1 of 3: Introduction to inheritable properties">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<link rel="manifest" href="/site.webmanifest">
+<link rel="apple-touch-icon" href="/icon.png">
+<link rel="icon" type="image/png" href="/icon.png">
+<link rel="stylesheet" href="/style/site.css" type="text/css" media="all">
+<meta name="theme-color" content="#98b0d4">
+</head>
+
+<body>
+<!--#include virtual="/site-banner.html" -->
+<!--#include virtual="/site-nav.html" -->
+<div id="site-content">
+<!--#include virtual="/site-notice.html" -->
+<!-- **************** BEGIN CONTENT ***************** -->
+
+<h1 class="post-title">Foreign Repository Copies</h1>
+<div>
+<p>This article is mirrored with permission from the original location
http://blogs.collab.net/subversion/foreign-repository-copies. Inactive links
has been removed or updated.</p>
+
+<p><strong>Author:</strong> C. Michael Pilato</p>
+<p><strong>Posted:</strong> 2013-06-28</p>
+
+<p>Some time ago, I <a title="Merging from Foreign Repositories"
href="2008-03-29-merging-from-foreign-repositories.html" target="_blank">wrote
in this space</a> about some new functionality that I had managed to work into
Subversion â the ability to merge changes into a working copy from a
so-called “foreign repository” (that is, a different repository
than the one reflected by the working copy). I touted the feature as a lovely
alternative way to manage vendor branches. I admit that I may have glossed
over the details a bit in that post, but the idea seemed simple enough:Â
import a baseline copy of the third-party codebase into your repository, and
thereafter merge the changes made by the third-party directly from their
repository into your local baseline copy. Voilà ! Vendor branches.</p>
+<p>Recognizing the potential of the foreign repository merge functionality,
I’ve since begun using this approach myself. I have a number of
CollabNet-related and personal projects which make use of third-party code.Â
CollabNet’s TeamForge and Subversion Edge products both use <a
title="ViewVC" href="https://viewvc.org/" target="_blank">ViewVC</a>, for
example. In many of those situations, there are small customizations that
need to be made to the third-party codebase. Vendor branches are the natural
way to manage those changes.</p>
+<p>But as I began to put the theory into practice, I ran into an unexpected
problem with that first branch initialization step: properties.  <em>svn
import</em> doesn’t recognize or replicate any Subversion file or
directory properties which might be recorded on the import source. Therefore,
when I would use <em>svn import</em> to instantiate my vendor branch with a
baseline version of the third-party code, I would get a hybrid mixture of
information. Sure, I had the vendor’s file contents and directory
structure perfectly replicated in my working copy. But the <em>metadata</em>Â
â node properties such as <code>svn:ignore</code>,
<code>svn:eol-style</code>, <code>svn:keywords</code>, and so on â was not
coming from the vendor’s original data source. It was coming instead
from my own local <a title="svnbook: Automatic Property Setting"
href="https://svnbook.red-bean.com/en/1.7/svn.advanced.props.html#svn.advanced.props.auto"
target="_blank">auto-props configuration</a>.</p>
+<p>Notice how in the following (somewhat contrived) example <em>svn
import</em> effectively loses the <code>svn:ignore</code> property which was
present in the third-party library:</p>
+<blockquote>
+<pre>$ svn co http://otherfolks.com/svn/trunk third-party-wc
+A third-party-wc/src
+A third-party-wc/src/source_file.c
+A third-party-wc/src/source_file.h
+A third-party-wc/notes
+A third-party-wc/notes/how_to_do_stuff.txt
+A third-party-wc/README
+Checked out revision 61.
+$ svn plist -vR third-party-wc/
+Properties on 'third-party-wc/src':
+ svn:ignore
+ a.out
+$ svn import -m "Initialize vendor branch." \
+ third-party-wc http://localhost/svn/my-project/vendor
+Skipped 'third-party-wc/.svn'
+Adding third-party-wc/src
+Adding third-party-wc/src/source_file.c
+Adding third-party-wc/src/source_file.h
+Adding third-party-wc/notes
+Adding third-party-wc/notes/how_to_do_stuff.txt
+Adding third-party-wc/README
+
+Committed revision 13.
+$ svn co http://localhost/svn/my-project/vendor vendor-wc
+A vendor-wc/src
+A vendor-wc/src/source_file.c
+A vendor-wc/src/source_file.h
+A vendor-wc/notes
+A vendor-wc/notes/how_to_do_stuff.txt
+A vendor-wc/Makefile
+A vendor-wc/README
+Checked out revision 13.
+$ svn plist -vR vendor-wc
+$</pre>
+<p><span style="color: #ff0000"><em>Oops! We’re missing an svn:ignore
property from the vendor!</em></span></p></blockquote>
+<p>As a result, the initial import of the vendor data would go just fine, but
then later â while performing a foreign repository merge which included
property changes â I’d end up running into property conflicts. The
merge would say, “Change property <em>NAME</em>‘s value from
<em>OLD_VALUE</em> to <em>NEW_VALUE</em>.” My working copy would frown
and reply, “But <em>NAME</em>‘s value isn’t
<em>OLD_VALUE</em> at all. It’s <em>SOMETHING_ELSE</em>.”Â
Boom. Conflict.</p>
+<blockquote>
+<pre>$ svn merge -r61:62 http://otherfolks.com/svn/trunk vendor-wc
+Conflict for property 'svn:ignore' discovered on
'/home/cmpilato/vendor-wc/src'.
+They want to change the property value to 'program', you want to delete the
property.
+Select: (p) postpone,
+ (mf) mine-full, (tf) theirs-full,
+ (s) show all options: p
+--- Merging (from foreign repository) r62 into 'vendor-wc':
+ C vendor-wc/src
+A vendor-wc/Makefile
+Summary of conflicts:
+ Property conflicts: 1
+$</pre>
+<p><span style="color: #ff0000"><em>Ugh.</em></span></p></blockquote>
+<p>In this example, the resolution of the conflict is easy enough. But
that’s not the point. Clearly, I needed a better way to initialize my
vendor branches. I ended up doing things the hard way for a while. Rather
than use <em>svn import</em>, I would use <em>svn add</em>, a slew of <em>svn
propset</em> invocations to manually mimic the source data’s property
set, and then <em>svn commit</em>. It was cumbersome, but it worked. In the
meantime, I filed a feature request for something better in the Apache
Subversion project’s issue tracker.</p>
+<p>I’m happy to report now that, thanks to the massive rewrite of
Subversion’s working copy management library which was the cornerstone of
Subversion 1.7.0, and with the specific additional efforts of my CollabNet peer
Bert Huijben, Subversion 1.8.0 provides support for foreign repository copies.Â
Initializing a vendor branch from a foreign repository now is as simple as
running <em>svn copy</em> with the foreign repository URL as the source, and a
local working copy directory as the target.</p>
+<blockquote>
+<pre>$ svn cp http://otherfolks.com/svn/trunk my-project-wc/vendor
+--- Copying from foreign repository URL 'http://otherfolks.com/svn/trunk':
+A my-project-wc/vendor
+A my-project-wc/vendor/src
+A my-project-wc/vendor/src/source_file.c
+A my-project-wc/vendor/src/source_file.h
+A my-project-wc/vendor/notes
+A my-project-wc/vendor/notes/how_to_do_stuff.txt
+A my-project-wc/vendor/README
+$ svn ci -m "Initialize third-party vendor branch." my-project-wc
+Adding my-project-wc/vendor
+Adding my-project-wc/vendor/README
+Adding my-project-wc/vendor/notes
+Adding my-project-wc/vendor/notes/how_to_do_stuff.txt
+Adding my-project-wc/vendor/src
+Adding my-project-wc/vendor/src/source_file.c
+Adding my-project-wc/vendor/src/source_file.h
+Transmitting file data ....
+Committed revision 13.
+$ svn plist -vR my-project-wc/vendor
+Properties on 'my-project-wc/vendor/src':
+ svn:ignore
+ a.out
+$</pre>
+<p><span style="color: #008000"><em>This time, our vendor’s svn:ignore
property was preserved! This means that later, when it’s time to merge
the vendor’s recent changes, the merge should run smoothly (so long as we
haven’t introduced conflicting customizations, of course):</em></span></p>
+<pre>$ svn merge -r61:62 http://otherfolks.com/svn/trunk my-project-wc/vendor
+--- Merging (from foreign repository) r62 into 'my-project-wc/vendor':
+ U my-project-wc/vendor/src
+A my-project-wc/vendor/Makefile
+$</pre>
+<p><span style="color: #008000"><em>Cha-ching!</em></span></p></blockquote>
+<p>For the sake of completeness, I should note that there is one exception to
the perfect preservation of the foreign repository’s data that occurs
during the copy: any <code>svn:mergeinfo</code> property found therein is
filtered out of the replica created in your local working. Doing so avoids a
host of problems that might occur were Subversion to think that the merge
tracking information applied to your <em>own</em> repository’s history.Â
But it all turns out okay. Since foreign repository merges likewise ignore
the <code>svn:mergeinfo</code> property, this exception won’t prevent you
from using such merges to maintain your vendor branch!</p>
+<p>Also, while the <em>svn copy</em> command syntax allows for the source and
target of the copy to each be either a repository URL or a working copy path,
it’s only the <em>svn copy REPOS-URL WC-PATH</em> syntax which supports
foreign repository copies. You can’t, for example, copy directly from a
URL in one repository to a URL target in another repository.</p>
+<p>For more details about using this approach to manage vendor branches, check
out my <a title="Vendor Branches from Foreign Repositories"
href="https://svnbook.red-bean.com/en/1.8/svn.advanced.vendorbr.html#svn.advanced.vendorbr.foreign-repos"
target="_blank">freshly re-written section of the <em>Version Control With
Subversion</em> book</a>. And for more information on what Subversion 1.8
offers, see <a title="Subversion 1.8 Release Notes"
href="/docs/release-notes/1.8.html" target="_blank">the official release
notes</a>.</p>
+<p>(And thanks, Bert!)</p>
+</div>
+
+<div class="h2" id="about-the-author">
+<h2>About the author
+<a class="sectionlink" href="#about-the-author"
+ title="Link to this section">¶</a>
+</h2>
+<p>C. Michael Pilato is a core Subversion developer, co-author of Version
Control With Subversion (O'Reilly Media), and the primary maintainer of ViewVC.
He works remotely from his home state of North Carolina as a software engineer
for CollabNet, and has been an active open source developer since early 2001.
Mike is a proud husband and father who loves traveling, soccer, spending
quality time with his family, and any combination of those things. He also
enjoys composing and performing music, and harbors not-so-secret fantasies of
rock stardom. Mike has a degree in computer science and mathematics from the
University of North Carolina at Charlotte.</p>
+</div>
+<!-- ***************** END CONTENT ****************** -->
+</div> <!-- #site-content -->
+</body>
+</html>
Propchange:
subversion/site/staging/blog/2013-06-28-foreign-repository-copies.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
subversion/site/staging/blog/2013-06-28-foreign-repository-copies.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Modified: subversion/site/staging/blog/index.html
URL:
http://svn.apache.org/viewvc/subversion/site/staging/blog/index.html?rev=1908741&r1=1908740&r2=1908741&view=diff
==============================================================================
--- subversion/site/staging/blog/index.html (original)
+++ subversion/site/staging/blog/index.html Sun Mar 26 20:17:15 2023
@@ -23,29 +23,126 @@
<p>The Apache Subversion Blog is a collection of articles concerning the
design and usage of Subversion. If you would like to contribute an
- acticle, please reach out to (dev@ or private@?).</p>
+ acticle, please reach out to the <a href="/mailing-lists.html">mailing
+ list</a> <a href="mailto:[email protected]"
+ >[email protected]</a>.</p>
+
+<div class="h2" id="blog-20130628">
+<h2>2013-06-28 — Foreign Repository Copies
+<a class="sectionlink" href="#blog-20130628"
+ title="Link to this section">¶</a>
+</h2>
+
+<p>C. Michael Pilato explains how <code>svn copy</code> can be used to
maintain a <a
href="https://svnbook.red-bean.com/en/1.8/svn.advanced.vendorbr.html">vendor
branch</a> to track source maintained in a foreign repository.
+<a href="2013-06-28-foreign-repository-copies.html">Continue reading</a></p>
-<div class="h2" id="blog-20220509">
-<h2>2022-05-09 — Some blog article
- <a class="sectionlink" href="#blog-20220509"
+</div> <!-- #blog-20130628 -->
+
+<div class="h2" id="blog-20130626">
+<h2>2013-06-26 — Repository Dictated Configuration - Part 3 of 3: Global
ignores
+<a class="sectionlink" href="#blog-20130626"
+ title="Link to this section">¶</a>
+</h2>
+
+<p>This is the final part of a series (the first two parts below) describing
repository dictated configuration (RDC). In part 2 we talked about the new
svn:auto-props property. Today we’ll discuss the other new inherited
property that involves RDC, <code>svn:global-ignores</code>.
+<a
href="2013-06-26-repository-dictated-configuration-part-3-global-ignores.html">Continue
reading</a></p>
+
+</div> <!-- #blog-20130625 -->
+
+<div class="h2" id="blog-20130625">
+<h2>2013-06-25 — Repository Dictated Configuration - Part 2 of 3:
Autoprops
+<a class="sectionlink" href="#blog-20130625"
+ title="Link to this section">¶</a>
+</h2>
+
+<p>Part 1 (below) described the new inheritable properties feature in
Subversion 1.8 which paves the way for repository dictated configuration (RDC).
In part 2 we look at the first part of Subversion 1.8′s RDC related
features, the new <code>svn:auto-props</code> property.
+<a
href="2013-06-25-repository-dictated-configuration-part-2-autoprops.html">Continue
reading</a></p>
+
+</div> <!-- #blog-20130625 -->
+
+<div class="h2" id="blog-20130624">
+<h2>2013-06-24 — Repository Dictated Configuration - Part 1 of 3:
Inheritable properties
+<a class="sectionlink" href="#blog-20130624"
+ title="Link to this section">¶</a>
+</h2>
+
+<p>This is the first article in a series of three describing the different
configuration options that can be set in the repository to manage the behaviour
of the working copy.
+<a
href="2013-06-24-repository-dictated-configuration-part-1-inheritable-properties.html">Continue
reading</a></p>
+
+</div> <!-- #blog-20130624 -->
+
+<div class="h2" id="blog-20121024">
+<h2>2012-10-24 — Reducing network traffic in Subversion 1.8
+ <a class="sectionlink" href="#blog-20121024"
title="Link to this section">¶</a>
</h2>
-<p>Preamble to introduce the article. Two or three sentences...
-<a href="20220509-filename.html">Continue reading</a></p>
+<p>Building on WC-NG released in Subversion 1.7, the repository access module
libsvn_ra_serf can significantly reduce network traffic for <code>svn
switch</code> and <code>svn update</code> if the file contents already exist in
the local pristine store. <a
+ href="2012-10-24-reducing_network_traffic_in_subversion_1-8.html">Continue
reading</a></p>
-</div> <!-- blog-20220509 -->
+</div> <!-- blog-20121024 -->
-<div class="h2" id="blog-20220412">
-<h2>2022-04-12 — Another blog article
-<a class="sectionlink" href="#blog-20220412"
- title="Link to this section">¶</a>
+<div class="h2" id="blog-20091119">
+<h2>2009-11-19 — Where did that Mergeinfo come from
+ <a class="sectionlink" href="#blog-20091119"
+ title="Link to this section">¶</a>
</h2>
-<p>This is also a very interesting article.
-<a href="20220412-another-filename.html">Continue reading</a></p>
+<p>Building on the existing <code>svn:mergeinfo</code> property, this
+ article descibes some technical details on subtree merges as well
+ as changes in Subversion 1.7. <a
+ href="2009-11-19-where-did-that-mergeinfo-come-from.html">Continue
reading</a></p>
+
+</div> <!-- blog-20080506 -->
+
+<div class="h2" id="blog-20080506">
+<h2>2008-05-06 — Merge info - Understanding the Internals
+ <a class="sectionlink" href="#blog-20080506"
+ title="Link to this section">¶</a>
+</h2>
+
+<p>Subversion 1.5 adds a versioned property <code>svn:mergeinfo</code>
+ to track merges between different branches. This article explains
+ usage and implementation details. <a
+ href="2008-05-06-merge-info.html">Continue reading</a></p>
+
+</div> <!-- blog-20080506 -->
+
+<div class="h2" id="blog-20080329">
+<h2>2008-03-29 — Merging from foreign repositories
+ <a class="sectionlink" href="#blog-20080329"
+ title="Link to this section">¶</a>
+</h2>
+
+<p>Starting with Subversion 1.5 you can merge changes from a
+ foreign repository. This article contains all details. <a
+ href="2008-03-29-merging-from-foreign-repositories.html">Continue
reading</a></p>
+
+</div> <!-- blog-20080506 -->
+
+<div class="h2" id="blog-20070613">
+<h2>2007-06-13 — Merge auditing
+ <a class="sectionlink" href="#blog-20070613"
+ title="Link to this section">¶</a>
+</h2>
+
+<p>A short description of the initial implementation of
+ <code>svn:mergeinfo</code>. <a
+ href="2007-06-13-merge_auditing.html">Continue reading</a></p>
+
+</div> <!-- blog-20080506 -->
-</div> <!-- #blog-20220412 -->
+<div class="h2" id="blog-20060910">
+<h2>2006-09-10 — Enhancing Subversion
+ <a class="sectionlink" href="#blog-20060910"
+ title="Link to this section">¶</a>
+</h2>
+
+<p>This article describe different ways of enhancing and customizing
+ a Subversion installation. <a
+ href="2006-09-10-EnhancingSubversionServer.html">Continue reading</a></p>
+
+</div> <!-- blog-20080506 -->
</div> <!-- #site-content -->
</body>