I made the mistake about 3 months ago of doing a force push to Mercurial, and somehow, it has remembered that...so whenever I push now, it forces it by default:
% hg --repository C:\Projects\Sonic\DDSF push --force ssh://192.168.52.2:22//hg/DDSF
How do I get rid of this setting and go back to the regular pushes?
My team gets mad at me daily because I'm constantly creating new heads and breaking stuff :(
I've checked my .hgrc file and its not there. I've also re-installed the TortoiseHg client in hopes that it would solve this problem but it hasn't.
In TortoiseHG, you can disable the setting as follows:
Go to the "Synchronize" screen via the menu View -> Synchronize or by clicking this button in the toolbar:
Click the "Options" button under the list of commits:
In the options window, there's a checkbox for the "force push" setting:
By the way, when force is enabled, you should already see this below the "Options" button in step two:
Related
Every time I restart Tortoise HG it resets the set of selected file filters:
The "ignored" and "subrep" items always come back CHECKED even though my preference is to leave them off.
Most THG settings end up in Mercurial.ini but as far as I can tell this one isn't being saved at all. Is there anything I can do to make it so?
I'm using:
TortoiseHg
version 5.9.2
with Mercurial-5.9.2, Python-2.7.18, PyQt-5.13.2, Qt-5.9.9
but this has happened in every version I can remember.
Using TortoiseHg Workbench, almost every time I pull from a remote repository, I have uncommitted code changes so that I need to shelve them before I update and then unshelve them again.
Is there a way to do this all in one click? I seem to remember being able to do this when I used Git (perhaps with GitHub for Windows).
Follow-up or comments
Tried to add button to THG GUI
Defined new tool in Tools menu
Added to toolbar (failed, no buttom on toolbar, I suppose, due to icon size /small/ - using path to big icon file instead of embedded may change visibility result)
Tried to add to Revision Context Menu and use added feature
As you can see - button added, but command failed (for unknown reason): using plain hg for PATH\hg.exe is recommendation from "Define tool" window from THG
I'm new to Mercurial and MercurialEclipse, and I think I'm not quite understanding this:
After I pull from the central repository (with Update After Pull selected), it is my understanding that all files are loaded form the central repo to my local repo. However, after I pull, I'm seeing the following:
Doesn't the star icon indicate that there are differences between my local copy and the central copy?
What am I missing here? How do I make sure that my files are the most recent copies?
Try right-clicking on your Eclipse project and select Team --> Refresh Status. I often have to do that for the status icons to be updated.
Edit: if you want to override all local changes, select the checkbox "Clean update (override local changes)" in the Pull dialog of Eclipse.
When you update it merges the local changes you have with the changes in the revision you are updating to. In the update dialog if you select the "force" checkbox it will revert any uncommitted changes. Other ways to remove your local changes are updating by right clicking on a revision in the history view and selecting "switch to", or use the "revert" dialog.
Simple question: is there a way to revert --all from TortoiseHg workbench? I see how to revert an individual file. Ideally, I could click on a revision, and from the right mouse menu find a "revert all" item.
I'm using TortoiseHg 2.8 on a Ubuntu box.
EDIT I should have provided more details on my question to provide some context. Let me describe the particular use case:
I want to put my working directory back to the state of a past commit so I can generate output from the executable that I know was "good". Once I've generated that output, I want to go back to the tip and continue my development, keeping this history linear. From the command line, I did "hg revert --all --rev 22", generated the output, then "hg revert --all", which did what I wanted. "hg update" will create a history with a branch (if I'm understanding correctly). FWIW there is an "update" button in TortoiseHg (in the box where the list of files is shown) as well as a right-mouse menu item on a given revision.
To set the working directory to match the state of a given changeset (which could be tip), you can use Update:
Right click on the changeset you want to 'revert' to.
Select "Update"
Check the "Discard local changes" checkbox
Click Update
It would be hg update -r changeset -C in the console.
Now you can create the output from the 'state' of the working directory at that point in history (i.e. from the executable at that changeset). If you don't make any commits here there will be no changeset created and therefore nothing is added to the repo history.
Once you have the output to your satisfaction, you can update again to the tip of development via the same process and continue your work:
Right click on the tip of development.
Select "Update"
Check the "Discard local changes" checkbox
Click update
The benefit of using update over revert is that Tortoise will explicitly display the parent of the working directory as the changeset it history. Under revert it could be very easy to revert the files and lose track of which changeset you had reverted to and which part of history you occupied.
(This is assuming that you want to move to that point in the history. If you need to create a changeset that undoes a prior changeset, look into backout, though I'm not sure if that is available in Tortoise.)
You can select all modified files in the list with Ctrl+A and then select "Revert" from context menu.
The Mercurial Workbench within TortoiseHG allows a graphical use of many mercurial functions. I have a patch sitting in a mercurial queue from which I want to extract some files to another separate patch.
I found a solution here for the command line approach:
Gaol: End up with OP=P1 + P2, where OP=Original Patch, P1=Patch 1, P2=Patch 2
Solution:
hg qpush OP
hg qrefresh <paths to keep> to replace OP with P1, including only the paths you named. The other changes will remain as uncommitted changes in the working directory.
hg qnew -f P2 to pick up those changes.
I simply cannot figure out how to do this within the workbench and would be glad if someone could teach me how to accomplish this. Thanks!
When you use the refresh button in TortoiseHg it acts on the ticked items in the list so to do what you ask you follow the following steps:
Click on your patch OP in the top list
Untick the the files that you want to go into the second patch on the list of changed files on the left
Click the refresh button on the right
Click on the working directory entry on the top list to see the rest of the files
Tick all the files on the list of changes on the left
Click on the new patch button on the right (click on the little down arrow on the commit button if that it's the active button to select the new patch button)
Obviously, enter any commit messages as required.