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 3271382
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:43:23+00:00 2026-05-17T18:43:23+00:00

Changes were made to our .vcproj to fix an issue on the build machine

  • 0

Changes were made to our .vcproj to fix an issue on the build machine (changeset 1700). Later, a developer merged his changes (changes 1710 through 1715) into the trunk, but the mercurial auto-merge overwrote the changes from 1700. I assume this happened because he chose the wrong branch as the “parent” of the merge (see part 2 of the question).

1) What is the “correct” mercurial way to fix this issue, considering out of all the merged files, only one file was merged incorrectly, and

2) what should the developer have done differently in order to make sure this didn’t occur? Are there ways we can enforce the “correct” way?

Edit: I probably wasn’t clear enough on what happened. Developer A modified a line in our .vcproj file that removed an option for the compiler. His check-in became changeset 1700. Developer B, working from a previous parent (let’s say changeset 1690), made some changes to completely different parts of the project, but he did touch the .vcproj file (just not anywhere near the changes made by Developer A). When Developer B merged his changes (becoming changes 1710 through 1715), the merge process overwrote the changes from 1700.

To fix this, I just re-modified the .vcproj file to include the change again, and checked it in. I just wanted to know why Mercurial thought that it shouldn’t keep the changes in 1700, and whether or not there was an “official” way to fix this.

Edit the second: Developer B swears up and down that Mercurial merged the .vcproj file without prompting him for conflict resolution, but it is of course possible that he’s just misremembering, in which case this whole exercise is academic.

  • 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-05-17T18:43:24+00:00Added an answer on May 17, 2026 at 6:43 pm

    I will address the 2nd part of you question first…

    If there is a conflict, the automated merge tools should force the programmer to decide how the merge happens. But the general assumption is that a conflict will involve two edits to the same set of lines. If somehow a conflict arises because of edits to lines that are not close to each other the automated merge will blithely choose both of the edits and a bug will appear.

    The general case of a merge tool always merging properly is very hard to solve, and really can’t be with current technology. Here is an example of what I mean from C:

    int i;  // Someone replaces this with 'short i' in one changeset stating
            // that a short is more efficient.
    
    // ...  lots of code;
    
    // Someone else replaces all the 65000s with 100000s in another changeset,
    // saying that more precision is needed.
    for (i = 0; i < 65000; ++i) {
        integral_approximation_piece(start + i/65000.0, end + (i + 1) / 65000.0);
    }
    

    No merge tool is going to catch this kind of conflict. The tool would have to actually compile the code to see that those two parts of the code have anything to do with eachother, and while that would likely be enough in this case, I can construct an example that would require the code to be run and the results examined to catch the conflict.

    This means that what you really ought to do is rigorously test your code after a merge, just like you should after any other change. The vast majority of merges will result in obvious conflicts that a developer will have to resolve (even though that resolution is often fairly obvious), or will merge cleanly. But the very few merges that don’t fit either category can’t easily be handled in an automated fashion.

    This can also be fixed by development practices that encourage locality. For example a coding standard that states “Variables should be declared near where they’re used.”.

    I’m guessing that .vcproj files are particularly prone to this problem since they are not well understood by developers and so if conflicts do appear they will not be sure what to do with them. My guess is that this happened and your developer simply did a revert back to the revision (s)he checked in.

    As for part 1…

    What to do in this case depends a lot on your development process. You can either strip the merge changeset out and redo it, though that won’t work very well if lots of people have already pulled it, and it will work especially poorly if there are lots of changesets that have already been checked in that are based on the merge changeset.

    You can also check in a new change that fixes the problem with the merge.

    Those are basically your two options.

    The tone of your post seems to me to indicate that you may have some politics surrounding this issue in your organization, and people are blaming this error on the frequent merges of Mercurial. So I will point out that any change control system can have this problem. In the case of Subversion, for example, every time a developer does an update while they have outstanding changes in their working directory, they are doing a merge, and this kind of problem can arise with any merge.

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

Sidebar

Related Questions

I use git to keep track of changes made by our development team and
We use liquibase to keep track of our database changes.. First changeSet contains those
I'm trying to determine if any changes were made to a particular entity object.
I'm making some changes to a legacy classic ASP application. I've made the changes
I have a ASP.net 2.0 app and I have made some changes the the
I've created a custom list, and made some changes to the way the CQWP
I've just create a new MVC project, and have made no changes at all,
Recently I made a bunch of changes to my local svn config file. Mainly
Given the case I made two independent changes in one file: eg. added a
Using Oracle 10g. I'm writing a script to apply the delta changes made on

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.