What is the standard fixation process for Hg?

it

  • to pull
  • update
  • mergers
  • commit
  • push

? Or can you commit first?

I don't like the idea of ​​pulling and merging without supporting my local code somewhere in the case of a merge merge, but presumably you need to perform the merge before you can make a click, t have conflicts in the central repo. I did not quite understand the whole process; used for my simple plain svn.

+4
source share
4 answers

I recommend that you always make transactions before making changes to the working directory, if you are 100% not sure that your changes and the changes that will be merged into your working directory will not conflict.

If you are performing an update ( hg pull; hg update or shorter hg -u pull ) and have any outstanding changes, any changes coming from outside will be merged with your changes. When conflicts happen, it can be difficult to decide what the result of the merger should look like, because you cannot easily distinguish between your changes and those merged into.

When you made your first order, it is much easier to decide what the result of the merger should look like, because you can always look at both parents of the merger. So in reality this is:

  • hg commit
  • hg pull -u (if merging is not required, go to 5)
  • hg merge
  • hg commit
  • hg push

Update: As Martin Geisler pointed out, you can get the “original” modified version of the file using:

 hg resolve --unmark the-file hg resolve --tool internal:local the-file 

or for all files at once:

 hg resolve --unmark --all hg resolve --tool internal:local -all 

However, I believe that the “complete first” system is better. In the end, this is a personal preference ...

+8
source

I don’t know how the standard is, but one of the ideas of Mercurial is that you can perform as often as you like, as it goes to your local repository. This way, you can capture your heart content as much as you want before you receive updates.

I try not to commit very often, saving time when I am getting ready to push, but that's me. I can see the utility of doing early and often. I often update updates when I work to reduce the pleasure of merging.

Another thing I do is to keep a parallel clone of my working repo (cloned from the same repository as my working repo, not cloning from my working repo) so that I can easily check the initial state of the file and if necessary - check out-of-band crash fix or anything-you without complicating my current set of changes.

+3
source
  • Make changes
  • Fix
  • Go to 1 until satisfied
  • Trailed
  • Merge and Hold
  • Click if you want.

Definitely fix before trying to do something as complex as a merge. I do not think that mercurial will allow you to merge before committing, but even if that happens, that if the merger goes wrong. You do not have a preliminary merge check to return to.

Commit in advance, commit frequently.

If you do not, you have missed the enormous advantage of DVCS.

+3
source

but presumably you need to do a merge before you can make a click because you cannot have conflicts in the central repo

Incorrect approval and poor understanding of distributed workflow and concurrent development.

  • You can combine heads before pressing, but does not have or should . Push can put any data into the repo, if necessary and intended for this.

    By default, push will not allow the creation of new chapters at the destination, since several heads will not be clear which head to use. In this situation, it is recommended to pull and merge before pressing.

(NB: " recommended to pull out and drain to")

You can use commit-pull-merge, stash-pull-unstash-merge, fetch with a modified WC and merge on the fly, do not lose your head at all or sporadically, and push --force with +1 vote is not a general rule for everyone . And any such workflow does not create “conflicts in the central repo,” but only another DAG .

Each point of discrepancy that appears when there is your and another set of changes from the parent-messenger in your (or even central) repo is a trigger point for anonymous branches in Hg, which (technically) are absolutely legal, applicable and normal way. How they are processed is determined by the policy and agreement between developers, PM, QA-team and others.

I personally prefer to finish my task (in one or more quantities) after it pulls and possibly merges when it approves the development policy

Part of repo

+2
source

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


All Articles