Discard remote changes in SmartGit/Hg - version-control

How can I discard remote changes in binary files when merging? There is only menu item to discard changes in local file. When I'm trying to "resolve" it tells it can't do that thing for binary file.
Sorry, I've mentioned "resolver" menu but it was "conflict solver". Log http://pastebin.com/xhGuc3du.
Although when I'm using "resolve" I see OK icon in the operations log (right bottom corner) but "conflict" label does not disappear. Log http://pastebin.com/DEDWQSht.

To discard remote changes, Local|Discard should be sufficient. To set your local content either to your own version before the conflict ('ours') or to the remote version ('theirs') use Local|Resolve and select the corresponding option there.

Related

How to cleanly clipboard copy code from a GitHub.com diff?

Consider the following split view code diff from a browser on GitHub.com:
While looking at this diff, I want to clipboard copy the code from the right-hand side (e.g. in order to paste that snippet into a different project in another window).
However, if I try to use the mouse to select the code on the right-hand side in the usual fashion, the code from both sides ends up selected:
And if I hit Ctrl+C / Cmd+C, I end up with kind of a mess on my clipboard which includes copies of the code from both sides, and all of the + and - indicators, which leaves me with a lot of error-prone manual cleanup to do after I paste. (Particularly when copying from a diff that's more long and complex then the simple one I picked out for illustration purposes in this question!)
My question: How can I cleanly and easily copy code from one side of a split view diff in a web browser on GitHub.com to my clipboard?
Update March 2021: this should be, this time, supported:
Copy one side of split diff
When comparing changes to a file using the split view, you can now select and copy just one side of the diff.
Previously both sides were copied. Selecting over a comment will still copy the comment's contents.
May 2018:
As mentioned by Hugo Giraudel in his tweet in late April 2018, a bit too quickly:
GitHub finally moved the + and - symbols from diffs to CSS pseudo-elements, making it possible to copy code directly from a diff without having to clean it up.
That is long overdue and fantastic. ✨
Actually... this is only true with the help of third-party extension!
Like sindresorhus/refined-github.
Without, you would still copy the '+' and '-'.
GitLab has that feature though.
This is still pending for BitBucket (issue 16204)
timotheecour reports in the comments that it does not help with side-by-side diffs:
the code from both sides ends up selected
This is in the context of using refined-github, a Browser extension that simplifies the GitHub interface: issue 2765.
Update Nov. 2020: that issue just got resolved with PR 3698

In Mercurial, how to "merge" with the commit's (single) parent?

I've worked on some project. I'm able to see the difference between my project and its (sole) parent with:
hg kdiff3
(After I've configured "kdiff3" as shown here). However, I want to be able to edit my files, perhaps remove some of my changes, edit some of them or make new changes. But that command only shows me the differences, rather than let me edit them. If I try:
hg merge 5861231e8335
(When "5861231e8335" is the (sole) parent of the working directory) I get:
abort: merging with a working directory ancestor has no effect
So how can I "merge" with the parent? (preferably using "kdiff3")
First, you have misunderstood what hg merge does. It merges changesets from 2 parents. It doesn't merge uncommitted changes.
To merge uncommitted changes into the current tip changeset, you want:
hg commit --amend
which replaces the current tip with a new one.
To answer your question about editing in a differencer. I'm not aware of any method of editing a bunch of files in a file differencer; that's because the set of files get copied into the temp directory where it's obviously pointless to edit them. You can however, diff and edit one file at a time because one file is diffed in place without copying to the temp directory.
But surely, isn't it better to edit files in your normal editor rather than in a file differencer? Surely, one can edit, but only as a last resort. OTOH, if you use the trick of viewing diffs one file at a time, it is possible to edit in your real editor, then watch the diffs change in the differencer.
hg shelve lets you temporarily put aside (on a shelf) parts of the diff between the working directory and its parent, so it will give you the "remove some changes" part of what you want. It does not let you edit, but you could put what you have changed on one shelf, then reimplement the change. If you want to revert to the original change, you just put the new change on a new shelf, and pull the original change off its shelf.
Alternatively, create a copy of the parent changeset using hg export (or hg clone and update to the parent changeset, but you don't need the history for this), Once you've got your copy, you can merge the copy of parent with your working directory using kdiff3 directly, outside of Mercurial.

How to switch the order of files (original and modified) in Eclipse Compare window?

When comparing two files, for example during a commit, Eclipse shows the original version on the right and modified on the left:
However, I would prefer to see the original version on the left and modified on the right. Is it possible?
Eclipse Neon.2 (4.6.2) has a button to swap the views:
You can either swap the views for every compare, as one answer suggests:
Or you can make the swapped order be the default for all compares:
Windows --> Preferences --> General --> Compare/Patch
Select the Text Compare tab, and mark the check-box of Swap left and right
I think it's just depending of which file you're selecting first. I mean, choose a file, and select compare to .. and choose another one. Next choose the second one and compare to the first one, they'll swap in your window :)
This behaviour is influenced by what exactly is compared. When comparing two local files the view is influenced by the first & second selection. If using e.g. GIT the left hand side will always be what is present locally, the currently checked-out branch or local changes - so changing the branch will influence the view. When using SVN it is mostly the same, so left hand locally, right hand remotly.

Beyond Compare 3 editing disabled

With BC2, when i click the Show differences... option in SourceGear Vault. It allow me to copy from the repository to the working version and save but I can't do this with BC3. It doesn't allow copying to the otherside (right) and have the editing disabled showing at the bottom of the BC3. It is even the same with DiffMerge. What am I not understanding here?
Can someone explain to me why the changes in BC3 and is there a workaround?
Beyond Compare will disable editing of a file for any of the following reasons:
It's one of the input files in a 3-way merge
The comparison was cancelled
The comparison encountered an error (corrupt file, invalid character encoding, out of memory, gamma rays, etc)
The file format's conversion settings don't support converting back to the original format (MS Word, PDF)
The file is on a read-only "filesystem" (7zip/RAR/CHM archives, CD/DVD-ROMs)
A file or parent folder had editing explicitly disabled by the user in the session settings or using the /ro command line switches
The viewer itself doesn't support editing (eg, Hex Compare prior to v4)
Also, the Full Edit (F2) toggle in the Text Compare View menu switches between inline editing and line-based mode. If it's disabled you can copy/delete whole lines and type in the line details edits at the bottom of the window, but the main windows won't have a cursor, typing is disabled, and it will always select whole lines. Unlike the above items, this doesn't show "Editing Disabled" in the status bar.
there must be a flag on the command line to call BC such as /ro# or /#ro or /(side)readonly (where side is left or right), it prevents editing.
these flags are there because differs are often called with temporary files to diff, in particular from SCC. and Vault probably has a single "external diff" command, thus you have to choose whether the flags are always there, it protects you from unexpectly editing a temporary file and loose this work when closing the diff tool, or not.
The few reasons I have found are:
If the encoding of the file is different than the default. In this case change the encoding to the expected one. (Japanese-ShiftJIS in my case)
If a refresh of files is in progress.

CFBuilder:- File dissappears from the SS/workspace off and on

What is the issue with CFBuilder?
I am trying to Check out a file from SS/CFBuilder and all i get is the message
80020009: Network not found.[src=SourceSafe,guid=null]
In fact even perfectly working files that are months old,suddenly become "removed from SS".As a result of which I have only "Team/Commit Changes" option for a given file.The "Team/CheckIn ..CheckOut" options are blanked out.
Also when I am trying to click the "Show Local History",for an pretty old/often used file, it throws an message
No local History available for selected resource!
The Same message is coming for each and every file.
Please help.
Vas
The issue is likely in Eclipse. Eclipse allows you to store local history for the files that have a size lower than 1 MB.
Goto Window >Preferences >General >Workspace >Local History
Increase the Maximum file size so that it is higher than the size of your files.
After applying the change, the next time the file is saved, Eclipse will create a history.