AnkhSVN - keep local copy and get latest version - version-control

I m new to use ankhSVN and having issues. I have created some new files which are not commited. It was required that i need to get latest version. I right clicked the folder and selected update. I didnt get the latest version and also my files were not present. It had a question mark icon towards the left.
Ideally i want to know what is the procedure to use ankhSVN.
Thanks and regards,
Ashish Agarwal
Ashish.Agarwal#Renishaw.com

[Unrelated: Please remove your e-mail address from your question if you don't want to receive spam.. you can be notified on updates via RSS and mail via your profile settings].
The 'folders' you see in Visual Studio are not normal folders/directories. They are just filters on your project. For some project types they map to actual folders (E.g. C#, VB and websites), but for other projects they don't (E.g. C, C++, Setup, Database, ...).
So actually you are just updating the selection of the filter/folder and everything below.
For most tasks you should always update on either the solution, the project level or a single file, as updating a subdirectory without the project referencing the files inside is an operation that can leave you with a broken project. (New files won't be included in your project and old files won't be removed).
AnkhSVN allows you to update the whole directory at once by checking the [X] Recursive checkbox at the bottom of the dialog, but this is currently not the default setting.

Related

How to merge files(differentiate) in visual studio code

I am using Visual studio code for angular2 application. The requirement is to merge files, so, I want to differentiate changes in two files as it happens in Netbeans IDE. Is there, any extensions available to achieve the task in visual studio code.
For e.g - Merging Two files by differentiating changes like below:-
Please suggest some solution.
abc.component.ts (located in project1)
abc <-- text for understanding purpose
def
abc.component.ts ( located in project2)
abc
I want to differentiate two component files and push changes in another like it happens in Netbeans IDE? Is there, any solution available for Visual studio code?
First using vscode natively with the git toolset
(Make sure to look on the second title as it's a better native way!)
This way may be available on older version of vscode too! Still a good thing to know! (even we should always run on the latest version! And vscode is always keeping getting better and better).
A native powerful and cool way is to use the git toolset within vscode! It still not the most fluid way! But if you are in a setup where you don't have anything else or time or resources to use anything else! Also as a requirement you need to have a git repo initiated! Here we go:
First we will use the change and diffing capability of the git tool set. And the steps go as bellow:
Commit all the current changes
once done: copy past the other file to diff on the place of the current one. And save.
Cool now in the git pallet you can see the file in changes list! Click on it and the diffing editor will show!
Bingo this is it! You can compare and make direct changment! The diffing will keep happening in real time. Note the current state is in the right. And you make changement there.
Here an illustration of direct modification for instance the part in the left is missing from the current file
And here another illustration (current have in plus)
Well to sum up! Git tool and diffing in vscode is so powerful! And all that one need! The only problem is the extra step of committing and cleaning after if desired!
Here some tips! If you want to have the commit history cleaner! Or not have a merge separate! You can remove the last commits from history as much as you need: Without hard reset and commit again a cleaner one!
git reset --soft HEAD~1
You can check
How to cancel a local git commit
Otherwise it can be ok with atomic commit and merge mention!
Also if what you need is to be able to keep a lot from the current file! You can copy the current elsewhere! past the other file to compare! commit ! and then past again the old one! You'll have the old in the right and as current (Not as described on the above) In such a scenario this work well! (Hacky a bit but you may need it).
Native way (direct open of the compare editor)
(May require the newer version of vscode)
open a file that you gonna compare
open the command pallet
CTRL + SHIFT + P
type file: compare
You can see the different possible ways! For a file we can choose compare active file with.
Then you choose the file! The file need to be within the project directory.
And then you choose a file and the compare editor will open
The above was tested on my brother computer on a new vscode installation. I wasn't sure at first if it was part of the core! And i just confirmed that it is. That too remove the need to the method above involving git! And it's the best native way to go with.
Vscode extensions
Here two extensions i suggest the first:
https://marketplace.visualstudio.com/items?itemName=jinsihou.diff-tool
Easy and simple! It add two elements to the right click menu:
In current file right click -> Select as first file for diff, select one again to view the diff results
select to compare and compare with select no more simple then that !
Another extension to check:
https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-diff
I prefer the first! As this one compare a lot to the native way. And having the control in the contextual menu is just great.
Out of vscode! Using other tools
A quick google search and you'll find a lot of tools!
https://meldmerge.org/
meld merge is cross platform and open source and nice!
in linux and debian:
sudo apt install meld
Otherwise you can check the long list here:
https://www.jotform.com/blog/25-useful-document-and-file-comparison-tools/
https://stackify.com/code-merge-tools/
There is too winMerge to mention (an open source project for windows)
https://winmerge.org/

Checked out clearcase file but can't check in

Using RAD 8.5/ClearCase 7.x, I checked out many files. I made my changes and was able to check many of the files back in (using the GUI RAD interface). However I'm unable to check in many other files by right-clicking on them in Eclipse. When I do right-click on them, the check-in & out options are disabled but the 'Add to source control' is enabled - RAD/CC react like these files are not in source control, but they've been controlled for many years. I am able to do a 'Find checkouts' (using RAD) and it lists those files. If I start up CC Explorer and check those files in my view, they show as 'View-private file'.
I've tried deleting one of these files via CC Explorer and then try to "re-add" it via the RAD GUI but I still get a generic error at that point that doesn't tell me anything.
How do I at a minimum get these files back in a state that I can check them out?
After working w/ our inhouse CC support staff, we've gone the route of them going in and undoing the check outs of the remaining files and then creating a new view. Then delete the "bad" view from my RAD workspace (as well as from the VOB) and import the new view. Because of additional CC plugin issues, we're also uninstalling RAD, WAS, and Clearcase to reinstall them. So this current situation is now closed.
I was facing the same issue in clear case view, this may not be the proper answer as I am not doing through eclipse, but it may help others. Solution was
Go to version tree of the file, right click on the checked-out node and there check in option was enabled.

How to use (share) a project wide spellcheck dictionary in Eclipse?

It doesn't make sense to have user dictionaries for multi-developer Eclipse projects, so I'm looking for a solution that would allow me to share a spell-check dictionary with all users.
As you can imagine the checkout and eclipse locations can be different for each user.
Also the dictionary should stay inside project directory because I want to add it to the version control system used by the project.
This question is targeted to the latest released version of Eclipse 3.7
To use project-specific dictionaries in all your projects, you could create a file .dictionary at the root of your project, and set the value of the "User defined dictionary" at (General->Editors->Text Editors->Spelling) to ${project_loc}/.dictionary. I don't know how to have BOTH a global dictionary and a project-specific dictionary, as the relevant preference page allows only one "User defined dictionary".
Note: that there can be some very confusing behavior when you don't have .dictionary files defined in a project. The behavior depends on some hidden cache behavior of the spell-checking implementation and your previous actions, and might be considered an Eclipse bug.
If you have just opened Eclipse, go to a project without a .dictionary, edit some file, and add a spelling to the dictionary, Eclipse will create the .dictionary file. That is strange because it won't even do that from the main wizard page. You have to create the file manually first before you can specify it.
If you were first working in project that does have a .dictionary, then switch to a different project without one, edit a file, and add a spelling, Eclipse will add it to the .dictionary in the original project!
Deleting entires in the dictionary or deleting the dictionary file will not cause the added words to be relabeled as misspelled, regardless of refreshing the project or file. Closing and reaping Eclipse does, however, restore the "misspelled" status of words.
FYI, I am using Eclipse Indigo Service Release 1; Build id: 20110916-0149 on Mac OS X lion.

Is there a way I can compare code in an old Xcode project with a new Xcode project?

I have a developer who has been working on an old Xcode project for me. Is there a simple way I can compare files in his new Xcode project to the ones in the new Xcode project to quickly see which changes he's done and how the old code has changed? He's be procrastinating and finally i have twisted his arm to send me the new Xcode project. He claims that the old code was rubbish, including the old coder too, so I'd like to see if he's actually done any changes to the old guy's project or is just plain and simple, 'a talker'.
Sure, use the "diff" command (from a terminal window).
If the two projects are in folders "old-project" and "new-project", respectively, you would do something like:
diff -r old-project new-project
The "-r" will recursively compare corresponding files in subdirectories.
ps. this should also be a wake-up call to you that's it's time to put your project into some kind of version control system (such as svn). If you had your project in source control, there would not be any question about exactly what had been changed, when, and by whom.
you can use FileMerge. it is under Developer/Applications/Utilities/FileMerge

TFS 2008, remove file from source control but leave it in the project

We are using Scott Hansleman's suggestion for multiple web.configs from his post here. The problem we have is that we have to check out the Web.Config. If we remove it from the project, when we publish, no web.config is pushed. So we need to remove the source control bindings just from the web.config, but leave it in the project, and have the rest of the project still held under source control.
The issue is that source control makes the file read only until you check it out. We need to be able ot overwrite it with the prebuild events, preferably without having to check it out. Is there a way to remove the bindings from that file only, and still leave it as part of the project?
Thanks.
By adding a new file to solution explorer, you will get the little plus sign indicating it is due to be added to source control. Then, right-click and choose "undo pending changes". This will cancel the add but leave the file in your project.
If that doesn't work I suggest one of the following methods:
Use the Attrib task from the MSBuild
Community Tasks project to remove
the read only flag.
Use the Exec
task in MSBuild to invoke
tf.exe and checkout the file.
You should leave the file in source control. Otherwise you'll run into several issues:
changes won't be versioned. 'nuf said.
it can't be branched or merged, even though web.config is one of the files that's most likely to vary between parallel dev/test/production environments
changes you make locally won't propagate to coworkers without manual workarounds
developers setting up an environment for the first time won't get the file at all
Team Builds won't contain the file, so neither will your deployments. (surely you're not deploying directly from the desktop?!)
Note that the state of individual files is stored entirely on the TFS server. ('tf properties' dumps this metadata if you're curious) Only projects & solutions have bindings actually written into the file. And even those are dummy entries that tell VS "don't worry about me, just ask TFSProvider, it'll know who I am and where I'm supposed to be." While there are many other quirks in the VS project system that give me endless headaches, in this case it's your friend. Don't circumvent it.
Best options:
Edit your build script to toggle the read-only attribute before/after modification. If you're using the "copyifnewer.bat" script from the linked blog post, it should literally be one extra line. Even if you want to keep things entirely declarative within the MSBuild makefile, it's barely any work with the help of 3rd party tasks.
Use the File -> Source Control -> Exclude feature. After applying this setting, the file remains under source control, but will no longer be subject to automatic checkouts/checkins by the active solution. In other words, you can edit the file locally to your heart's content without affecting anyone else, but if you want to commit (or shelve) your changes you'll need to do it from Source Control Explorer or the command line.
Option #1 has the advantage of being a very quick fix for your existing setup. The downside comes from maintaining several copies of web.config.* Same reason why copy/pasting code is bad: if you change one, you have to go change all the others -- or worse, forget and let them drift out of sync until strange bugs force you to revisit the issue. This could be improved by changing the process so that there's only 1 "master" web.config and the additional copies only contain differences (via a textual diff engine, XSLT transforms, programmatic manipulation in Powershell, etc). Of course, that's more work.
Option #2 avoids #1's problems with very little overhead. (the engineering process itself is unchanged; only difference is how the Visual Studio UI behaves) This advantage is critical if you make changes to web.config at all frequently. Downside is that there is no built-in way to track variations on the "master" file. If the only diffs are dirt simple, eg a connection string or two, you may find it easiest to stick with just one "master" and let people make ad hoc changes on their dev machines. There are even tools to do this for you, such as Web Deployment Projects (easy) and the IIS Deployment Tool (complex). In any case your actual deployment should be automated and source-controlled, of course! If heavier customizations are required than these tools are capable of, then you'll probably want the hybrid master + transform approach described earlier.
I recently ran into the issue and could not find a good solution. With a little trial and error I was able to figure this out myself.
This works on Visual Studio 2015. I tried to follow the answer above, but 2015 does not have an "Exclude From Source Control Option" I could find. It does have source control / project integration where if you delete the file from source control or the project, it will automatically be removed from both places. This integration is enforced when you have the solution containing the project open.
The problem is when using a web.template.config, web.config is really a build output and should not be in source control. However deleting the file entirely and removing it from the project causes problems because then the file is not part of the Build / Publish steps.
So the work around turns out to be simple:
Close the solution. File --> Close Solution.
In the Source Control Explorer Window, Delete the file.
Check in the Change.
Open your solution and you will see that the Config file remains in the project.
You may see the Triangle / Exclamation Mark Icon warning showing the the config file is not found.
Rebuild the project and click on the file.
The file should now show without the warning.
It should not have the padlock icon next to it. This indicates that it is not under version control.
I did some more checking and found the "Exclude From source Control" feature. The key is that you need to select the item in the Solution Explorer window before selecting the menu item:
Select the Web.config file in the "Solution Explorer".
In the menus select File -> source control -> advanced -> Exclude Web.config from Source Control.
You will now get a Red Circle / White Line icon.
This works if the file is NOT ALREADY in source control.
If the file IS ALREADY in source control you need to do the procedure above to remove it from source control without also deleting it from the project.