Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8291391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:06:52+00:00 2026-06-08T13:06:52+00:00

In exploring functionality in Subversion, I attempted to test the use case described in

  • 0

In exploring functionality in Subversion, I attempted to test the use case described in the Undoing Changes subsection of the Basic Merging section of the Branching and Merging chapter of the svnbook. I’m using version 1.6.4, but the text for that section is the same in both versions of the book.

In my working copy directory, I edit a file testcode.py, adding one line per edit, and committing after each edit. After several commits, the file reads as follows:

this is my first import to trunk.  r1.

this is my first commit, first edit of testcode.py.  r2.

this is another edit of testcode.py.  r3.

this is an edit of testcode.py.  i'll get rid of this one.  r4.

this is another edit of testcode.py.  keeping it.  r5.

yet another edit.  keeping it.  r6.

The revision numbers in the repository match up to the lines in the file such that in /trunk/testcode.py@rN, the last line of the file is the one ending with rN. What I want to do is remove the line ending in r4, keeping everything else before and after unchanged.

Following the example in the Undoing Changes section of the svnbook, I run the command

svn merge -c -4 file:///path_to_repos/trunk

This creates a conflict (upon running that command, not on commit), whereby the merge-left file contains everything up until line r4, and the merge-right file contains everything up until line r3. In other words, instead of removing a past change, the command seems to want to revert the entire file back to either revision 3 or 4, removing changes in subsequent revisions (5 and 6, in this case).

The way I read the example in the svnbook, which has the user reversing a change committed in revision 303 and committing the result to revision 350 with no conflicts, the command I ran should have produced a file with an svn status of M that retains all lines except the one ending in r4.

Am I reading the book’s example incorrectly, is the example wrong, or is there some other form of user error I fell into unawares?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:06:53+00:00Added an answer on June 8, 2026 at 1:06 pm

    The basic issue is that Subversion’s diff algorithm handles changes at the beginning and end of files in a way that’s not necessarily intuitive. Your example hits that corner case, while the majority of changes in the wild do not. Consider a file that looks like this after a series of commits:

    later commit (r5)
    change to be reverted at beginning of file (r2)
    initial commit (r1)
    change to be reverted in middle of file (r3)
    initial commit (r1)
    change to be reverted at end of file (r4)
    later commit (r5)
    

    Trying to revert the commits to the beginning or end of the file (revisions 2 and 4 in the example), gives a conflict. Reverting the change to the middle of the file works as expected.

    Conceptually, it might help to think of changesets as having a scope limited by surrounding lines. A change to the middle of a file is bounded by the surrounding unchanged lines. The scope of a change at the beginning or end of a file extends all the way to the beginning or end of the file regardless of how far away that point is subsequently moved.

    So in the example above, the second line added in revision 5 comes right in the middle of revision 4’s scope. In the same way that you’d expect a conflict reverting revision 10 here because changes in revision 11 are smack dab in the middle of it:

    ...                    <-- Line unchanged by revision 10, bounding its scope
    line from revision 10  <--\
    line from revision 11     | Revision 10's scope
    line from revision 10  <--/
    ...                    <-- Line unchanged by revision 10, bounding its scope
    

    you should expect a conflict here, for the same reason:

    ...                    <-- Line unchanged by revision 10, bounding its scope
    line from revision 10  <--\
    line from revision 11     | Revision 10's scope
    <EOF>                  <--/ (No unchanged line bounding the scope this direction)
    

    Note that this is only meant as a conceptual explanation of why the beginning and end of the file are seemingly treated differently, not as a comprehensive explanation for understanding Subversion’s merge process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was exploring the installer functionality of Castle Windsor based on the answers from
I am exploring the use of Selenium 2 on a web application which requires
Lets say an application is broken into modules, each module exposing functionality via EJBs.
Exploring a new data set: What is the easiest, quickest way to visualise many
I've been exploring methods for full-width background images combined with type. I found this
I have been exploring patterns in various MV* frameworks out there and today noticed
I'm exploring the possibilities of the ASP.net Webpages 2 with Razor, and trying to
I start exploring the fundation of Ruby, it is the C, printf('%%\\'); Does the
I have been exploring different answers about release management in Mercurial and almost found
I've been exploring ways that it might be possible to promote the business of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.