This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[ JDK VERSION : 1.7.0_45 ] STEPS: * Have 2 branches A and B. * Update working directory to A. * Do some changes. * Merge Changes with B * Switch to B -> positive acknowledge. * Commit ACTUAL: Commit was recorded on branch A. EXPECTED: Commit should be recorded on branch B.
Did you commit between: > * Merge Changes with B and > * Switch to B -> positive acknowledge. ? Or are you trying to commit the actual merge into the other branch?
No, I was trying to commit the merge to the other branch. The reason was: The changes contained a refactored move of some java classes in A to another package path to merge with the files, just in the same path in the other branch B, so I wanted to track the move + merge within the Mercurial repository.
you must have missed some steps in your scenario or at least i do not understand it. If i: 1) have two branches and am currently on A 2) merge branch B into A 3) try to switch to B => i get an error correctly saying hg update is not allowed after a merge. See the screenshot. For example iin your scenario you surely missed a commit between * Do some changes. and * Merge Changes with B. You should never merge into a dirty working copy. If you do that you probably do not know how distributed systems work.
Created attachment 147796 [details] error not allowing switch to branch
(In reply to Ondrej Vrabec from comment #3) > you must have missed some steps in your scenario or at least i do not > understand it. No, I intentionally left out the commit between "some change", i.e. refactor to different java package, and "merge with B". > 1) have two branches and am currently on A > 2) merge branch B into A > 3) try to switch to B => i get an error correctly saying hg update is not > allowed after a merge. See the screenshot. Don't you think, this error message should also appear, if there additionally was a change between 1) and 2), if such scenario is not allowed? I didn't have it. Could you reproduce my experience if you insert such package renaming or other changes before the merge? If not, I may prepare my little .hg folder and send it to you. > You should never merge into a dirty working copy. I often profit from this. If I do some changes manually before the merge, than I have less weird conflicts to solve with the Conflicts Resolver. This works fine except when I additionally want to commit the result to a different branch as demonstrated by this bug. > If you do that you probably do not know how distributed systems work. Hm, may be, in my case I do not share the repository with others, so the "distributed systems" concerns do not matter here. If I understand correct, technically a commit on 2 heads is nothing more than 2 diffs (in respect of possible renamings in contrast to subversion) combined in 1 changeset. So I do not see a reason why my scenario should be impossible to process.
> If I understand correct, technically a commit on 2 heads is nothing more than 2 diffs (in respect of possible renamings in contrast to subversion) combined in 1 changeset. So I do not see a reason why my scenario should be impossible to process. Sure, technically yes. But the merge commit should never contain any actual changes besides the conflict resolution. Otherwise the changes will be more difficult to find (when searching history), harder to revert (if you later realize the change was incorrect). But if you use the repo only locally i guess it does not matter. If * Switch to B passed without any errors for you it is strange. Can you paste here the content of the output window? After such a switch to branch action I'm getting: > Switch to branch BRANCH in: > C:\Users\Ondra\Documents\NetBeansProjects\merc\245270\2\245270 > ERROR Command failed: > Command: [hg, update, -v, --config, ui.merge=internal:merge, --repository, C:\Users\Ondra\Documents\NetBeansProjects\merc\245270\2\245270, BRANCH] > Output: [abort: outstanding uncommitted merges] > INFO: End of Switch means the command failed. Maybe we just parse the output of your hg executable in a wrong way.
Hi Ondrej, I've tried to reproduce the case and realized, that it seems I have misinterpreted the message box. From flippant reading I interpreted "invoke Commit" as "Don't forget to commit". I feel sorry for the noise. Additionally I discovered, that my "rename first and than merge" trick to track the move didn't work as expected. The source information, to see with "hg status -C", was lost after the merge :-( Even later "hg copy -A src/path/file test/path/file" was rejected by error message. FYI: I opened an issue here: https://bitbucket.org/tortoisehg/thg/issue/3796/allow-commit-to-different-branch
> FYI: I opened an issue here: https://bitbucket.org/tortoisehg/thg/issue/3796/allow-commit-to-different-branch TortoiseHG will hardly fix it. If it's a general issue for hg client, it should go here: http://mercurial.selenic.com/wiki/BugTracker, http://bz.selenic.com/
Thanks! Now here: http://bz.selenic.com/show_bug.cgi?id=4293
Oops!
The discussion from http://bz.selenic.com/show_bug.cgi?id=4293 discovered a new bug 245322.