On Mon, Aug 05, 2019 at 12:00:26AM +0200, Ludovic Brenta wrote:
> Le 2019-08-04 23:45, Hendrik Boom a écrit :
> > I committed two revisions on the main branch of development that should
> > have been made on a new branch. (just to be awkward, some of those
> > edits should have been made on the main branch and others not. Each
> > revision is a mixed bag)
> >
> > How can I recover?
> >
> > Isn't there some way to remove recent commits as long as they haven't
> > sync'd to any other data base?
> >
> > Because I checked the copy of the data base on the server, and they
> > don't
> > seem to have gotten there yet.
> >
> > So maybe I can check out the recent committed revisions (elsewhere, as
> > backups), revert those commits, and then hand-edit the changes back
> > that should have been on the main branch, subsequently start a new
> > branch, and then and edit the new-branch changes back onto the new
> > branch.
> >
> > Does this sound practical? Anyone have a better idea? Or an obvious
> > gotcha?
> >
> > My alternative would seem to be more drastic: delete the local database
> > altogether, copy an old version of it from the server, and try to
> > recover from there.
>
> I would use SQL commands to delete the branch certs on the two offending
> revisions. This would prevent them from being synced to other databases.
> Of course, prior to doing that, revert any working trees to an ancestor
> revision.
Following up from your suggestion and trying to figure out how to use
sql for this, I found two commands:
mtn local kill_certs selector certname [certval]
and
mtn local kill_revision id
This second one looks like what I was asking for. I'd still have to
back up the files in a few previous revisions so as to identify changes
and apply them selectively (probably by hand) to the main and new
branches.
But if were to remove the branch certs (using the first instruction),
is there also a way to install branch certs for the new branch? This
would seem to be the simple way to set up the new branch properly.
Of course I'd still have to go over the differences line by line to copy
selected changes to the main branch.
Of course there's a way to install new branch certs, or at least the
equivalent. set up the new branch, then mtn propagate from the main to
the new branches. *Then remove certs from the wrong commits on the main
branch. Would be nice to have something more direct, that just attaches
a sert, but this would work. There would be fewer junk revisions left
lying around.
-- hendrik
>
> --
> Ludovic Brenta.
>
> ___
> Monotone-devel mailing list
> Monotone-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/monotone-devel
___
Monotone-devel mailing list
Monotone-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/monotone-devel