On Tue, 2014-07-22 at 01:20 -0500, Steve Borho wrote: > On 07/21, Ross Boylan wrote: > > TortoiseHg 2.4 on Debian GNU/Linux. I made a commit, which consisted of > > some changes and the addition of 2 files, and then wanted to change the > > comment. Then I did (all from the GUI) an undo, which created a commit > > that undid the previous commit--not what I was looking for. Then I > > selected backout (I think--all from memory). Though I did 2 operations, > > the log window only shows one. > > The undo button on the commit tool just does a rollback. The menu option > Repository->Undo does the same. We do have a backout dialog but it is a > 'wizard' with multiple pages like a merge. From the sound of things, > you couldn't have gone through those steps. I recall both using the backout and going through the dialog that I now see when I do backout (except now it says I have uncommitted changes).
> > > The output log in the GUI does not contain the commit that reversed the > > previous commit, but the files I added are missing from the working > > directory. hg update has no effect. > > > > Log (displayed in TortoiseHg GUI): > > % hg add > > --repository /home/ross/UCSF/HIVRace /home/ross/UCSF/HIVRace/simpleMatch.R > > /home/ross/UCSF/HIVRace/simpleMatch1.pdf > > [command completed successfully Mon Jul 21 20:23:10 2014] > > % hg commit --repository /home/ross/UCSF/HIVRace --verbose --user Ross > > Boylan <[email protected]> --message=Add new section (F) [rest of > > comment omitted] > > [ -- /home/ross/UCSF/HIVRace/HIVRaceGrant.lyx > > /home/ross/UCSF/HIVRace/simpleMatch.R > > /home/ross/UCSF/HIVRace/simpleMatch1.pdf > > HIVRaceGrant.lyx > > simpleMatch.R > > simpleMatch1.pdf > > committed changeset 12:3b19a97ca3cf > > [command completed successfully Mon Jul 21 20:23:10 2014] > > % hg rollback --repository /home/ross/UCSF/HIVRace --verbose > > repository tip rolled back to revision 12 (undo commit) > > working directory now based on revision 12 > > [command completed successfully Mon Jul 21 20:24:41 2014] > > Which would have been this operation. > > I'm thinking perhaps post-rollback the commit tool was confused for a > short bit and show negative diffs? I don't know. In any event, any > second attempt at a rollback should have failed, only one transaction is > 'undo-able'. > > Something very odd did happen for those two added files to be deleted. > Note that rollback has been deprecated by Mercurial, they heavily > suggest using the amend command instead. I remember one of the dialogs (not sure if it was from the undo or backout) had something about changing the working copy. I left the defaults. My first attempt generated changeset 13, which reversed changeset 12. If this was applied to the working directory that means it would have deleted the new files. And then maybe the other operations took those to be local changes I made and preserved those changes? > > > The log shows an add, a commit, and a rollback. There is no sign of the > > creation of the commit that reversed the earlier one, and only one > > operation appears (hg rollback) after the original commit, although I > > performed at least 2 steps after that. > > Not all operations get logged, unfortunately, though that is something > that is being improved. Is there any kind of reverse logging associated with a rollback (or any other operation I might have done)?. That is, after my initial undo the logged looked like this (giving just one entry for each commit, even though the log has multiple lines): commit 12: add and modify files commit 13: reverse 12 Then when I undo 13 it actually cleans the last entry out of the log, which then has only commit 12: add and modify files with the history of commit 13 and its reversal omited > > > Several questions: > > 1) how do I get the working directory to match my current tip (revision > > 12)? hg revert? Is there a way to do it from the tortoise gui? > > answers below I ended up doing "hg revert .", which seems to have worked (for goal 1 only, not 2). > > > 2) Is there any way to amend the comment for what is now the tip commit? > > How? (I have a feeling it's not possible because of the subsequent > > reversing commit and its removal). > > if the tip is still a draft (has not been pushed and published) you can It is > use amend (see the drop-down option list on the commit button). You > enter amend mode, update the comment, click amend. I don't see such an option list. Perhaps that was added after the version (2.4) I have (it's what Debian stable uses). Mercurial is 2.2 > > > 3) What would have been the right way to handle my initial goal of > > revising the newly created commit log message (with raw hg or tortoise)? > > hg amend or hg commit --amend My version has no hg amend command; it does have several --amend options on commands. > > > 4) What happened? In particular, why does the log seem to be missing > > some of the transactions I did? > > answer above > > > I have not pushed any of this mess anywhere else. > > > > Thanks. > > Ross Boylan > > > > P.S. The doc say hg rollback does not affect the working directory, but > > that hg update brings the working directory in sync with the tip. But > > the tip has the files I added, and the working directory does not, even > > after hg update. > > > > Terminal (after all the above): > > ross@tempserver:~/UCSF/HIVRace$ hg update > > 0 files updated, 0 files merged, 0 files removed, 0 files unresolved > > ross@tempserver:~/UCSF/HIVRace$ hg status > > M HIVRaceGrant.lyx > > ! simpleMatch.R > > ! simpleMatch1.pdf > > These are "missing" files in hg nomenclature > > hg update -C will recover them, but will also undo changes to 'M' status > files. I think I want to back out the M changes as well, since they probably reflect the fact that the work copy looks like revision 11 rather than 12. > > You could also: hg revert simpleMatch.R simpleMatch1.pdf > ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds _______________________________________________ Tortoisehg-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss

