Confluence gives me an old version to edit - page corruption - confluence

I have a Confluence page where I need to change some data. But when I hit edit, the page that loads into the editor is an old version, missing some of the content that was there a second ago in view-mode. I cannot have that vanish, I need to build on top of that!

My admin says it's some kind of corruption. While there is obviously something wrong with the server, I need to do my job and so I found a workaround:
In view-mode, open the page's menu and select copy. You will get to an editor containing the current version of the page that is corrupt. Select all and copy that to the clipboard and discard the duplicate. Go back to the corrupt original, hit edit and paste the up-to-date version from the clipboard. Save, then apply your changes as usual.

Related

How to get permanent link to a file with BitBucket server?

Sometimes I want to provide a link to some source code in the comment to an issue.
If I open repository in browser and find the fileI need, the link refers to master branch by default. It means that over time the code referred by the link will change, because the master will move together with commits history.
In GitHub and GitLab when you want to get a permanent link on a file you just opened, it is enough to press y on the keyboard and the link will switch from referring the master branch to particular commit hash it points to.
I.e. https://github.com/octocat/Hello-World/blob/master/README -> https://github.com/octocat/Hello-World/blob/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d/README
At work I use BitBucket server (v7.10.1, if it matters) and unfortunately the y does not work, and I also do not see any button on UI to get permanent link. How can I achieve the same result (get permanent link) on BitBucket server?
I know a couple of tricks I am not satisfied with:
using Bitbucket Linky plugin for Intellij, but I want a more light-weight way
pressing History button on a file, and choosing the most recent one (but it does not give you the master hash, it gives the hash of the last change of the file. And also this button won't work if the file has a single version and never changed after the 1st commit)
Got to the version you want, and then click 'Raw file' (top right hand side of screen)
The path in the address bar should now be a permanent link. It will be the raw version of the file unfortunately, but it is a permanent link.

Sourcetree, View file in old version/commit

How do I view a particular file from a particular commit/version?
I have seen the solution where you view the file in (any) History, right-click it and select Log Selected and then choose Open Selected Version. However, this only works when I can find the file in History, which means I need to find a commit/version where the file was updated. I don't have this info.
I have also seen solutions where I can checkout the old version. However, I'd like to avoid this. I have current files open in editors and want to keep them there, unchanged. Generally, I find that checking stuff out and creating new branches sometimes creates annoying head/branch/whatever errors that I'd just as well avoid just to view a single old file.
I used to use TortoiseHG where I could right-click any version, choose to view the files in that version, get a window showing all files, and then open any file from there as a temp file.

Possible to revert back to old documents Sitefinity?

I have just started working on sitefinity and was replacing some documents. However I replaced the wrong document and published it.
I went into the version history for the document but when I click on the older version I cannot even open up the older file. The button is there but I cannot click on it.
I also tried reverting to an older version and then publishing but this also did not work.
There is no real code to paste so I would just like to know whether it is a bug with Sitefinity or whether it is even possible to go back to an older version of a replaced document.
Thanks in advance.
If you replace the file - then it really replaces it and there is no way of reverting it back from the revision history.
Hopefully you have a backup of the DB (or the blob storage) and you might be able to restore it.

Subclipse conflict resolution

Me and my friend using flex builder (eclipse based) with subclipse for a project.
Before committing I always update but sometimes I could not commit because of conflicts. Then I use Team->Synchronize with Repository and it shows at the right side latest from repository and at the left side the my current working copy. It has a button to copy from all non-conflicts from right to left (from latest repository to my working copy). But there are still conflicting lines.
Sometimes I just want to copy from left to right but there is no button for that (I mean overwriting repository file lines with my lines). After copying non-conflicting parts from right to left I just want to commit left side (I want to overwrite and commit my final file to repository). I cannot commit because of these conflict issues. Then my friend can use Replace With-> Latest from Repository command to get latest overwrited version.
Subclipse documentation is weak I could not find any good guide on the Internet. Could you explain subclipse conflict resolution step by step for a dummy like me? A video showing the steps, or an alien technology to fix it quickly will be fine. Are there any better (easier) solution for source control for eclipse?
(I use subclipse 1.4)
Yes, you are right. There is no button for that. in the Diff View(Side-by-Side View) the items in red are in conflict. They can not be automatically merged. You must review the item in conflict and manually resolve it by copying/editing the block of code that is in conflict.
After committing to or updating from repository(Synchronize with Repository) you'll see in the Console view that some items are in conflict. When you take a look at that file in Package you'll see 3 files right next to your original file:
myfile.txt (original file)
myfile.txt.mine
myfile.txt.r3293
myfile.txt.r3501
Right-click your original file then select Team -> Edit Conflict. In the Diff View provided, edit the file on the left-side to match the final result you want. (i.e. You may want to keep some of your changes and copy over new update from the revision in SVN, discard all changes and only keep your changes, etc.) After you are done, save the file. Right click your original file again then select Team -> Mark Resovled.
You will see that the addition 3 files disappear. You can now "safely" commit your work.
There is no easy way to do this since SVN can't decide what's the best option when such conflict arise.
I know this thread is old, but if someone is looking for an updated answer, my experience can help.
I'm using subclipse 1.8. Right-clicking on the original file and selecting "Mark Resolved...", you'll have several options, among others, take the local file or the base file as the correct version. You can save time with these options.
I can't find "Mark Resolved" so instead I clicked "Mark as Merged" after manually deleting the generated files.
Do the following steps:
Copy your latest working updates to a safe place.
Select the file which has conflicts..right click > select replace with>>Select Latest from Repository.
Then go back to your saved working copy and manually replace the current file contents (which has been overwritten in above step) with yours.
Then from team select Commit...
This way conflicts should be resolved and you saved your latest updates to SVN Repository.

Can I safely edit a renamed file in perforce

I have a file I need to move that's already under perforce. Once moved it needs some editing - update the package, etc - appropriate to its new location. Should I submit the move changespec and then reopen it for edit, or can I do this in one go? If so, what is the appropriate sequence of events?
I have done this before in one go, but depending on your build process, I recommend against it. What I generally do is this:
Move the file.
If the move needs a change in order to compile, open it for edit and make those changes.
Submit the changes, telling perforce to reopen the files for editing.
Make the changes for path, etc., that don't cause compile errors but should be updated.
Submit those changes with an appropriate description.
If you want to, however, you could just do all your changes in step (2) above. Perforce might change the flag for the new file from integrate to add, but it still remembers the source path for the file.
Edit: Better method
I realized that I often use a different method, but the idea of "moving" the file distracted me. So, I would recommend these steps instead:
Integrate the file into the new path/name, leaving the previous file there. I am assuming that this won't break your build process.
Submit the new file, checking it out again for edit after submission.
Make the required changes to the new file, and to the project so that you are using the new file.
Submit the edits for the new file.
[Optional] You might need to check through branch specs to see if you need to map the old file into the new one in any branches.
Create a changelist for deleting the old file, and submit it sometime later.
This method allows the edits to be cleanly separated from the rename/move, while never leaving the project in a state that won't compile.
Also, why wait for step 6? Sometimes, especially on bigger projects, you might want to move a file that another person is editing. Perforce will helpfully tell you this. By waiting to delete the file, you allow your coworker(s) to finish the edits and submit without needing to move their work manually. After the edits are submitted, they can be integrated into the new file, and then the old one can be safely deleted.
Submit the move change and then reopen for edit (you could use the reopen option too).
This is much more readable to the user in the change history.
Also, recent versions of Perforce do perform checks for changes to files after resolution. So, there may be complaints editing files after some resolve operations have been completed.
I would say always submit first then edit. It is much cleaner and makes it more obvious whats happening in your repository. Then simply checkout the file in the new location and make whatever changes. This also makes it much more obvious that the changes were made in the new location and to all it to work after renaming.
Yes you can. Simply reopen for edit the branched file (i.e. the new one). In P4Win, there is a context menu for this ("re-open for edit").
"Safely" is probably an important point here. Once you rename or move the file it'll get a revision number of "1" which looks like a new file to your Perforce client. Of course, admins will be able to get its prior history, but if the editing/version history of the file is important to you it's a little harder to get the older revision.
Update: Thanks to Commodore Jaeger and Greg Whitfield for enlightening comments.
This wasn't easy to track down regarding what the One True Answer is, even from Perforce support, so I figured I'd update everyone on what we found:
Perforce stores all versions of every document in its database.
If it's saving your file as type <text> or <ktext> then it stores the diffs of one file version to another and not the entire file.
If you check out a file, make no changes to it, and then re-submit, it will save as a new version with 0 diffs. This is configurable and P4 can be set up to ignore changelist items without any actual diffs. You can force this behavior by selecting "Revert unchanged files..." before you submit a changelist.
Use "Rename/Move..." to move files in P4 so it can track them. Don't copy them using Windows Explorer and then re-add them in P4.
If you use the "Rename/Move..." function from the context menu, the "new" file will show a revision number of "1" as though it were a new file.
However, since P4 saves every function performed on a file, you can actually get to any previous revision (and even recover "deleted" files) with the CLI command p4 filelog -i
If you want to get to the revision history of a moved or renamed file and you're not an admin, you can right-click and select its "Revision Graph" which shows every version of a file even when moved between branches.
According to Perforce support, easier tracking of revision history through branch or folder moves is an oft-requested feature and is in their current roadmap.
Perforce's answer: At the moment, there isn't a way to move/rename/integrate files and still maintain the exact file history.
However, if you were to choose "Integrate..." by right-clicking on the folder that you want to share, the versions of the files of the newly branched folder and underlying files will start from revision #1, but the integration history between the branched folder and underlying files and the original folder and underlying files will remain through which you can trace the revision history of the files.