Mercurial does not show modified file - xaml

I've been working with Mercurial (on windows and using TortoiseHg) for some time now, but today I experienced something I just do not understand.
I'm sure, that I've made some modifications to a file (view.xaml). When I manually compare the local file with the one committed to the repository, I can identify the modifications. But when I do a hg status it does not show any modified files...
First thing I checked was, that I had actually saved my work. While doing this, I noticed, that in the windows explorer, it showed the file as modified for just a short time (like 10-20 seconds). Then it changed again and showed as unmodified.
Second thing I checked was the ignore list and view.xaml is not on the ignore list.
Can anyone enlighten me, as to why Mercurial does not show this file as modified?

Related

TFS - reconstructing lost overwritten code?

I was working on a solution and under the assumption that I had already checked in my changes, I pulled down a new version of the solution and all the changes disappeared.
One of my colleagues suggested that as I often ran it in debug mode that there might be a dll kicking about that I can reverse engineer but dlls all seem to have overwritten too.
This is about 2 weeks worth of work so any help would be appreciated.
If you didn't shelve or check in the changes before the overwritten, I'am afraid you'll not be able to revert the file.
However when you edit the files in local, the changes will be temporarily saved to the TFS temporary diff files in "C:\Users\{user}\AppData\Local\Temp\TFSTemp". The files all have names like "vctmp38604_939733.cs". You can get the changes from them.
So, you can have a check for the folder, hopefully the diff files still there.
Just a suggestion: please ALWAYS shelve or check in code in time in case missing the changes.

Make PhpStorm watch (specific) file and upload upon change

I'm looking for a way for PhpStorm to watch a file - so that every time it changes, it should sync that file to the remote server. And the 'Upload external changes'-option (with the 'On explicit save action') is not working for me. It's close - but no cigar. It makes me save the css-file twice - and only after the second time I save the scss-file, then it uploads the gulp-compiled-style.css-file, as I would like it to do after the first 'save'. I know it's an itty-bitty thing - but for something that I easily do 200-400 times per day, I would like it to run as smooth as possible. It's both the time I spend saving the file twice - but it's also the doubt in my mind, every time something doesn't act like I want it to - then I always have to check first, if the file is uploaded properly.
I'm working with Wordpress and I have a 5-8 SCSS-files, that are being compiled using gulp. The gulp-procedures are quite comprehensive (autoprefixer, merge-media-queries, minifycss, etc., etc.), so it takes a couple of miliseconds for the file to be compiled. I assume that it's that compile-time that makes PhpStorm 'miss' that the style.css has changed - and therefore don't upload it on the first 'save'. Because sometimes everything is uploaded after the first 'save' - but it's only every 8th time (or so).
Extra fun fact (that may indicate where the body is burried): If i run the gulp watch from a terminal in the background, then I have to save the file, wait for at least 2-4 seconds and then save again, before the gulp-compiled-style.css-file is uploaded. If I press 'save', 'save', 'save', 'save' - with less than those 2-4 seconds pause, but with only 1 seconds pause, then PhpStorm never sync's the gulp-compiled-style.css-file.
If I run the gulp watch from PhpStorm's Gulp-integration (not the terminal, but the Gulp-prompt), then I can save twice in a row with only .5 second pause between (as soon as the progress bar in the bottom disappears) - and then it uploads (every time, - consistently).
It's only the upload of the gulp-compiled-style.css-file that is the problem. Everything else is working perfectly.
Here's what I have tried:
**Attempt1) I've previously used Atom, where the FTP-configuration was established using a plugin with a .ftpconfig-file. In that file, there was a 'watch: []'-parameter, where I could specify a file to 'watch'. That worked wonders!! I've tried finding a plugin that did something of the sort - but couldn't find it.
**Attempt2) I read one of the support-pages, concerning the same. It seems like that if the SCSS-files are compiled using PhpStorm, then it knows to upload the style.css-file (after it has been compiled). I can't setup my gulp-file using PhpStorms' SCSS-compilation (since it compiles it and then pipes the content through multiple procedures. And if I change projects and have to set that up every time, then that would be a pain to maintain.
**Attempt3) I thought about making a macro or something. And then seeing if I could remap CMD-s to 'save-current-file-and-execute-the-macro'. But then if I don't edit the scss-file (but just some php-file), then it would still upload the style.css-file. It's by no means a pretty solution, - but it just shows how far out in the ropes I've been, to find a solution to automate this.
**Attempt4) I thought about building it into the gulp-file, that it has to upload the style.css-file after compiling the style.css-file. I thought about getting the host and the username from the .idea-folder - and getting the password from the keychain and then establishing the sftp-connection that way. But it quickly became extensive to do this, so I hoped that there was an easier/better way.
Addition1
LazyOne asked, what I had tried with the File Watchers, so here goes. I tried making PhpStorm compile the Scss-file (so PhpStorm basically did what Gulp does for me today).
So that was a SCSS-filewatcher (file type), the scope was the SCSS-files in my project, pointed the 'Program' to my ruby-installed scss-file, etc., etc., etc.
However... I realized that it was difficult to get PhpStorm to do the same thing to the Scss-files as the Gulp-file does.
The Gulp-file that I'm using is supplied with each project (as a default) - and we're several webdesigners working on the same projects. So if I suddenly do something other that use that Gulp-file, then I'm pretty sure that I will have to be able to produce the exact same result, - otherwise I'm pretty sure that my colleagues will skin me alive. But I made it as far as to have this as my Arguments, before I gave up (I still need to do several things in this line, before it does what my Gulp-file does):
--no-cache --update $FileName$:../../style.css --style compressed --sourcemap=none
... However... When doing that, then I could conclude that the style.css-file was uploaded on every save (score!). Which means that if I can just setup some kind of File Watcher, then hopefully PhpStorm will watch that file and therefore upload it after Gulp has compiled the style.css.
So I tried to make a File Watcher, that watches the style.css-file - but I didn't know what to put as my 'Program'. Since basically I want PhpStorm to poke the style.css-file three times with a stick - and thereafter realize that the file has changed and upload it to the server. Is that possible to do automatically?
Ok. Here's how it's done!
The important part is that PhpStorm watches the style.css-file. It will do that, if you point a File Watcher to look at the file. Now, at first I tried running the Gulp-file with a File Watcher. Then I tried compiling the scss-files with the File Watcher. But that is not necessary. The important part is the 'Output paths to refresh' (as #LazyOne pointed out in the comments). So the best solution I've come to, is to make a bash-script that does nothing. It looks like this:
#!/bin/bash
sleep .01
I've called that 'donothing'. I don't have to do the sleep .01 for it to work, - but it doesn't stop it from working (based on the 20 upload tests I've done). And in my mind, it's better if there's a short delay, after the scss-files are saved (so the gulp-integration in PhpStorm have time to finish compiling the style.css-file).
Here's the setup of my File Watcher:
The scope is a custom-made one, and I've set it to this:
file[PROJECTNAME]:wp-content/themes/THEME_NAME/assets/sass/*
But I assume the scope could just be the entire project, since it's just looking for when SCSS-files change in that scope, before the 'Program' is executed (if I've understood this whole File Watcher thingy properly).
And I'm working on a project, where the SCSS-files are at
/wp-content/themes/THEME_NAME/assets/sass/STYLEDIRNAME/
And in this case, then the 'Output paths to refresh' should be set to something along these lines:
$FileDirRelativeToProjectRoot$/../../style.css
or
$ProjectFileDir$/wp-content/themes/THEME_NAME/style.css
And if you unfold 'Other options', then you have to set Working directory to be the root of the project, for it to work:
/Users/USERNAME/dropbox/foo/bar/
A downfall for this solution is, if PhpStorm are faster than the Gulp-task, - since it would then upload the style.css-file before the Gulp-task has finished compiling it (and therefore uploading the old or an incomplete file). That didn't happen during my 20 brief tests. But if it happens, then I would set a higher delay in the 'donothing'-file and see if that solves it.
Addition 1
I just experienced, that it wasn't working - that it didn't upload style.css upon every compilation/save (but I could swear that the setup was correct). So I restarted PhpStorm and then it worked. I tried restarting the gulp watch-process first, - but that didn't make a difference.
Another, much simpler solution is to set the File Watchers scope for SCSS files to "All Changed Files".
This is what my File Watcher setup looks like.
It compiles the .scss file, copies the minified .css into another folder, and then automatically uploads both files to the server if you have "Auto upload" enabled.
(You might note that I'm not using the SCSS compiler but the PHP-based PSCSS, which is about 70% faster and can be installed via composer global require scssphp/scssphp).

Get back lost shelf changes

I have shelved my 26 java files changes via Intellij Idea 2016.2.1 and I checkout to different branch.
When I came to old branch to check my shelved changes.
I gone a mad now, I lost all the files. I was worked nearly two months
Can somebody help to get it back?
You can restore the state of those files if they were edited in IntelliJ. Use local history to see all the changes made in IntelliJ (VCS -> Local History -> Show History).
Even there isn't Shelf tab in IDE you can find shelved changes as patch files at {ProjectName}/.idea/.idea.{ProjectName}/shelf/.idea/shelf.
Then your can apply any selected patch.
I was able to view lost changes and revert back to them by:
right click on project directory, select Local History > Show History
Find the entry in the history menu that you want to restore. You can examine the files by double clicking on the entry and the files to examine differences.
Right click on the entry you want to restore, and select Revert
Note in my case Git>VCS Operations>Show History showed nothing. Only through the Project Files menu.
Andrei's answer was helpful for my situation where I renamed my project and my previously shelved changes were no longer found under the shelf, but I did run into an issue when applying the patch file because I was prompted to "Select missing base" for various files in the patch. Similar to what is seen in the screenshot below:
https://youtrack.jetbrains.com/issue/IDEA-183910
I was able to avoid having to "Select missing base" for various files by first changing the default shelf location and then applying the patch.
https://www.jetbrains.com/help/idea/shelving-and-unshelving-changes.html#change-shelve-location
Also, I found my patch in this location:
{ProjectName}/.idea/shelf
instead of the aforementioned location:
{ProjectName}/.idea/.idea.{ProjectName}/shelf/.idea/shelf
Maybe this will help someone:
I lost part of my shelved changes in combination with an update of IntelliJ. I'm not sure if the update was the reason but eventually most of my most recent (and important) changes were gone.
I couldn't restore them from local history as this does not "survive" an update of IDEA. But in the files I saw that there still is some data:
C:\Users\myUser\AppData\Local\JetBrains\IntelliJIdea2021.2\LocalHistory had a changes.storageData with ~50MB.
Copying the files to the folder of the new version didn't help as the files got overwritten again.
Solution:
I was able to get the old version of IntelliJ (2021.2) here and installed it. This can be done in parallel, without removing the newer version.
Here I was able to retrieve my changes from the Local History and shelve or apply them again.
Hint: Backup the "Local History" folder (or the whole IntelliJIdea20xx.x folder) before you start. I don't remember if I had to copy it in there again or if it worked out of the box. (Just to be sure the local history doesn't get lost).
I've also experienced this bug repeatedly and hence no longer use shelved changes, but rather the Git CLI directly. As of 2022 Jetbrains IDE's still cannot be trusted with their "Smart Checkout" feature, which has a small probability of the total loss of your files (experienced personally in both IntelliJ & Rider).
Unlike another comment here regarding using the Local History, this did not work for me as the history showed nothing. I've also lost many hours of work due to this bug which remains unfixed.
The solution is to use "git stash -u" on the command line, then checkout the desired commit. Once youre done, type "git stash apply" to restore your files. Trusting the "smart checkout" feature is like playing Russian roullette. It's IDE magic that may just fail and you lose everything.

Move file in one AccuRev workspace that has been edited in another workspace

We have a need to refactor a code base. The thing is that this will be done by one person and it would be desirable to avoid having the rest of the development team sitting idle while this job takes place.
We therefore tried the following scenario to see if it is possible to work in parallel.
Created file test.txt in directory first in developer A's workspace.
Promoted this file.
Updated developer B's workspace, thereby getting file test.txt
In A's workspace moved file test.txt to directory second.
Promoted this move.
In B's workspace edited file test.txt while it still resides in directory first (no update is made thereby emulating that work is done while refactoring is taking place).
Tried to promote and got a message saying that file test.txt had been modified (correct, file has been moved).
Tried to merge but got an error message saying that AccuRev can't merge since the file is missing in directory second (where it has been moved).
Tried to update B's workspace but that is not allowed since there is a modified file that needs to be merged first.
We are now stuck in a catch 22 situation.
We did try to place a fake file in directory second but that is not being recognized since this file does not belong to the workspace.
Has anyone out there tried something like this and gotten it to work?
It is of course possible to copy files but if there is a better way we would be grateful to hear about this. Or if this is a known bug or limitation in the tool.
We will contact also contact AccuRev support but I thought that I might be able to get some useful tips from the community.
Currently we are using AccuRev client 5.5.0.
Thanks for any suggestions on how to make the tool support this operation.
Referring to your steps 6 & 7: In AccuRev 5.5 after a file is edited and has a (modified) status you first have to keep before you can promote.
At step 8 you could try doing the merge from the Browse Versions view of the file. That way you can select any node to merge with, including the one that has been moved.
Step 9. An AccuRev update will not run successfully if one of the files to be updated is (modified). This is by design. You can keep the file so it has (kept)(member) status then run the update.
David Howland
After contact with AccuRev support the answer is that the only option available is to copy the file to some temp directory, revert the changes, update the workspace and copy the file into the new location in the workspace.
AccuRev will at least tell you which files you have to copy since they will be marked as modified.
I could experimentally verify David's remark to step 9 using AccuRev 5.5.
Let's assume that in the workspace of user A the file was moved and the move was promoted, while in the workspace of user B the file was modified and user B is about to promote his/her change.
Before the file is kept, it will not be possible for user B neither to merge nor to update. But after keeping the modified file the update is possible. The file is first marked as overlap, then the merge succeeds in the new location. Basically, this avoids creating a copy of the file, reverting it and restoring it in the new location after an update, which can be quite cumbersome, as AccuRev does not reveal easily where the move goes.
If user B promotes the modification before user A promotes the move, all goes smoothly, i.e. on update the moved file appears as overlap, but easily merges into the moved file in the new location.
Similar results are obtained when the two users have workspaces connected to different streams and the overlap occurs on a common parent stream. Only if the file is unkept, an error can occur (i.e. only if the move is promoted before the change). Then a simple keep allows to proceed as usual (update, merge, then promote).

Accurev - why not Auto-Update?

Why isn't it standard behavior for Accurev to automatically run an "Update" upon opening the program? "Update" updates a user's local sandbox with the latest files from the building/promoted area.
It seems like expected functionality that the most recent files should be synchronized first.
I'm not claiming that it should always update, but curious as to why an auto-Update wouldn't be correct.
Auto-updating could produce some very unwanted results.
Take this scenario: you're in the middle of a development task, but you've made a mistake and need to revert a file that you just modified. So you open AccuRev, but before you have a chance to "revert to most recent version", you are bombarded with 100 files that have been changed upstream including the one you want to revert. You are now forced into the position of resolving all the merge conflicts before your solution will build, including the merge of your (possibly unstable) code in progress.
Requiring the user to manually update keeps a protective 'bubble' around the developer, allowing them to commit (keep) changes within their own workspace without bringing down code changes that could destabilise the work in their sandbox. When the developer gets to a point where his code is ready to share with others, that is the appropriate time to do an update and subsequently build/retest the merged codebase before promoting.
However there is one scenario that I do believe auto-updating could be useful: after a workspace is reparented. i.e. when a developer's workspace is moved from one part of the stream hierarchy to another. Every time we reparent we have to do a little dance:
Accept the confirmation dialog that reminds us (rather verbosely) that we need to update our workspace before we can promote any changes.
Double-click the workspace to view its files.
Wait for AccuRev to do a "Pending" search, to determine whether any file changes are waiting to be committed.
And finally, perform the Update.
Instead of just giving us a confirmation dialog, it would be nice if AccuRev could just ask us if we want to Update immediately.
I guess it depends on preference. I for one wouldn't like the auto-update feature.
Imagine you have a huge project and you don't want to build it every time you start Accurev. But you also can't debug because the source files and debugging info no longer correspond.