Hg: How to gradually get through the changes?

I am new to Hg. I have a function that works, but not now. I want to gradually undo the changes until I get to the version where it works. I'm not quite sure what the best way to do this.

I tried to clone the repo on the old version and saw that it works there. So ... how do I upgrade to subsequent changes now? The cloned repo revision defaultand tipis the one to which I cloned it.

Do I need to apply corrections? Is the shelf changing? I'm not sure.

+3
source share
3 answers

You must use the command bisectto quickly determine when your function has stopped working. It works as follows:

You start by resetting the bisect state and marking the current parent version of the current working directory as bad:

hg bisect --reset
hg bisect --bad

Now make an assumption when you think the function is working. If you think this works on June 1st, you can do

hg update -d '<Jun 1'

updatethe command is what you use to update the working directory in accordance with this set of changes. See hg help datesfor a list of date formats. Now you should test this revision, and if this function works here, you mark it as good:

hg bisect --good

If the function does not work in this set of changes, mark it as bad and update it even further into the past:

hg bisect --bad
hg update -d '<May 1'

, . , Mercurial : . Mercurial , . , .

, . , , , , . ! , 10 1024 - :-) Mercurial .

( "good/bad" ):

% hg bisect --reset
% hg bisect --bad
% hg update -r -100
61 files updated, 0 files merged, 9 files removed, 0 files unresolved
% hg bisect --good
Testing changeset 11414:0fa4474bdc2f (99 changesets remaining, ~6 tests)
46 files updated, 0 files merged, 0 files removed, 0 files unresolved
% hg bisect --good
Testing changeset 11439:778377be3662 (50 changesets remaining, ~5 tests)
17 files updated, 0 files merged, 0 files removed, 0 files unresolved
% hg bisect --bad
Testing changeset 11428:4d03c3680400 (25 changesets remaining, ~4 tests)
6 files updated, 0 files merged, 0 files removed, 0 files unresolved
% hg bisect --bad
Testing changeset 11420:a99ef3711890 (13 changesets remaining, ~3 tests)
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
% hg bisect --bad
Testing changeset 11417:6f1d1ed3e19a (6 changesets remaining, ~2 tests)
4 files updated, 0 files merged, 0 files removed, 0 files unresolved
% hg bisect --good
Testing changeset 11418:67bb9d78f05e (3 changesets remaining, ~1 tests)
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
% hg bisect --bad
The first bad revision is:
changeset:   11418:67bb9d78f05e
user:        Matt Mackall 
date:        Mon Jun 21 13:25:42 2010 -0500
summary:     merge: sort arguments to stabilize the ancestor search
+3

,

hg pull -r <revision> [<original repo>]

.

0

To find a version in which this feature was missing, you can try hg bisect. You can find it here .

tiplast revision in the repo, the defaultname of the branch that is used by default in the repo when it is created. you can add the remaining changes (changes) by pulling them.

hg help pull
0
source

Source: https://habr.com/ru/post/1752582/


All Articles