How can I learn to understand how Mercurial works as an experienced git user?

I have been using git for a while, and since this is the only DVCS I have ever used, I have learned to rely a lot on how it works for my workflow.

Now I am in a new company, and they use Mercurial, so I need to understand the Mercurial model and its difference from git, adapt my workflow and avoid costly mistakes.

So what resources can I use for this?

+5
source share
1 answer

Rather advanced conceptual differences from the official Mercurial wiki .

stackoverflow: Git Mercurial?

:

: "", "", " " " ". , , :

  • , , ( , , ,...).
  • , Git , Mercurial ( , , ).
  • . Git , Mercurial ( - ?).
  • , . Mercurial , . Git , "".
  • , ( "", ):

    • Git "objects" ( "commit object", "tree object", "blob object" " ", , , SHA1). "- ". , .git/objects. , , , , . :

      git show -s --format=raw <commitid> # changeset content
      git ls-tree <treeid> # list tree content
      git show <fileid> # blob content
      
    • Mercurial "" "revlog (NG)" . .hg/store/data (revlogNG). , "-".

      :

      hg debugindex .hg/store/data/<file>.i # hg debugindex <file> also works but you see less of internals
      

      , nodeid hg log.

      ,

      hg debugdata .hg/store/data/<file>.i <nodeid>
      

      ( , hg log) .hg/store/00changelog.i ( hg debugindex .hg/store/00changelog.i, , hg log nodeid ). id XXXX, hg debugdata .hg/store/00changelog.i XXXX . ( , YYYY)

      .hg/store/00manifest.i. nodeid YYYY.

      hg debugdata .hg/store/00manifest.i YYYY
      

      "filename + nodeid". foo/bar nodeid ZZZZ ( foo/barZZZZ).

      , foo/bar:

      hg debugdata .hg/store/data/foo/bar.i ZZZZ
      
    • :

      • Git , ( ) ( ). Mercurial , .

      • Git a blobid a treeid ( commitid tagid), . Mercurial a changesetid changesetid ( () (blob)), .

  • Git , Mercurial - ( , ).
  • Mercurial "" "rebase", (?), , , concurrency. .
+8

All Articles