PageSourceSearch

https://sapling-scm.com/assets/js/259f8a5e.72f99cfd.js

js sapling-scm.com collected 2026-10-03 20:10:53 UTC 6,385 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["2699"],{69201(e,i,n){n.r(i),n.d(i,{metadata:()=>a,default:()=>h,frontMatter:()=>t,contentTitle:()=>o,toc:()=>c,assets:()=>l});var a=JSON.parse('{"id":"introduction/differences-hg","title":"Differences from Mercurial","description":"While Sapling began 10 years ago as a variant of Mercurial, it has evolved into its own source control system and has many incompatible differences with Mercurial.","source":"@site/docs/introduction/differences-hg.md","sourceDirName":"introduction","slug":"/introduction/differences-hg","permalink":"/docs/introduction/differences-hg","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/sapling/tree/main/website/docs/introduction/differences-hg.md","tags":[],"version":"current","sidebarPosition":50,"frontMatter":{"sidebar_position":50},"sidebar":"tutorialSidebar","previous":{"title":"Differences from Git","permalink":"/docs/introduction/differences-git"},"next":{"title":"Debugging Sapling SCM","permalink":"/docs/introduction/debugging"}}'),r=n(74848),s=n(28453);let t={sidebar_position:50},o="Differences from Mercurial",l={},c=[{value:"Sapling has different default behavior and options for many commands.",id:"sapling-has-different-default-behavior-and-options-for-many-commands",level:4},{value:"Sapling has no \u201Cnamed branches\u201D.",id:"sapling-has-no-named-branches",level:4},{value:"Sapling has remote bookmarks.",id:"sapling-has-remote-bookmarks",level:4},{value:"Sapling allows hiding/unhiding commits.",id:"sapling-allows-hidingunhiding-commits",level:4},{value:"Sapling makes editing commits a first-class operation.",id:"sapling-makes-editing-commits-a-first-class-operation",level:4},{value:"Sapling supports the same revset and template features as Mercurial.",id:"sapling-supports-the-same-revset-and-template-features-as-mercurial",level:4}];function d(e){let i={a:"a",code:"code",h1:"h1",h4:"h4",header:"header",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.header,{children:(0,r.jsx)(i.h1,{id:"differences-from-mercurial",children:"Differences from Mercurial"})}),"\n",(0,r.jsx)(i.p,{children:"While Sapling began 10 years ago as a variant of Mercurial, it has evolved into its own source control system and has many incompatible differences with Mercurial."}),"\n",(0,r.jsxs)(i.p,{children:["The list of differences below is not comprehensive, nor is it meant to be a competitive comparison of Mercurial and Sapling. It just highlights some interesting differences for curious people who are already familiar with Mercurial. Many of the differences from Git also apply to Mercurial and ",(0,r.jsx)(i.a,{href:"/docs/introduction/differences-git",children:"that list"})," should be referred to as well. Sapling has substantial scaling, implementation, and format differences as well that are not covered here."]}),"\n",(0,r.jsx)(i.h4,{id:"sapling-has-different-default-behavior-and-options-for-many-commands",children:"Sapling has different default behavior and options for many commands."}),"\n",(0,r.jsxs)(i.p,{children:["Sapling removes or changes the behavior of a number of Mercurial commands in order to make the behavior more consistent with modern expectations. For instance, in Sapling \u2018sl log\u2019 by default shows the history from your current commit. In Mercurial ",(0,r.jsx)(i.code,{children:"hg log"})," shows the history of the entire repository at once."]}),"\n",(0,r.jsx)(i.p,{children:"Features that are off by default in Mercurial, like rebase, are enabled by default in Sapling."}),"\n",(0,r.jsx)(i.h4,{id:"sapling-has-no-named-branches",children:"Sapling has no \u201Cnamed branches\u201D."}),"\n",(0,r.jsx)(i.p,{children:"In Mercurial, a user may create bookmarks or branches."}),"\n",(0,r.jsx)(i.p,{children:"In Sapling, there are only bookmarks.  \u201CNamed Branches\u201D in the Mercurial sense do not exist."}),"\n",(0,r.jsx)(i.h4,{id:"sapling-has-remote-bookmarks",children:"Sapling has remote bookmarks."}),"\n",(0,r.jsx)(i.p,{children:"In Mercurial, there are only local bookmarks which are synchronized with the server during push and pull."}),"\n",(0,r.jsxs)(i.p,{children:["In Sapling, there are local bookmarks which only ever exist locally, and there are remote bookmarks, such as remote/main, which are immutable local representations of the location of the server bookmark at the time of the last ",(0,r.jsx)(i.co
1de,{children:"sl pull"}),"."]}),"\n",(0,r.jsx)(i.h4,{id:"sapling-allows-hidingunhiding-commits",children:"Sapling allows hiding/unhiding commits."}),"\n",(0,r.jsx)(i.p,{children:"In Mercurial, to remove a commit you must either strip the commit entirely, or use an extension like \u201CEvolve\u201D to semi-permanently prune the commit."}),"\n",(0,r.jsx)(i.p,{children:"In Sapling, commits are never removed/stripped from your repository and can easily be hidden/unhidden at will."}),"\n",(0,r.jsx)(i.h4,{id:"sapling-makes-editing-commits-a-first-class-operation",children:"Sapling makes editing commits a first-class operation."}),"\n",(0,r.jsx)(i.p,{children:"The original Mercurial design avoided editing commits.  While later extensions added some ability to edit commits (rebase, amend, strip, etc), it can still feel like a second-class feature."}),"\n",(0,r.jsx)(i.p,{children:"Sapling treats editing commits as a first-class concept and provides a variety of commands for manipulating commits and recovering from manipulation mistakes."}),"\n",(0,r.jsx)(i.h1,{id:"similarities-to-mercurial",children:"Similarities to Mercurial"}),"\n",(0,r.jsx)(i.h4,{id:"sapling-supports-the-same-revset-and-template-features-as-mercurial",children:"Sapling supports the same revset and template features as Mercurial."}),"\n",(0,r.jsx)(i.p,{children:"Revsets and templates largely work the same as they do in Mercurial."})]})}function h(e={}){let{wrapper:i}={...(0,s.R)(),...e.components};return i?(0,r.jsx)(i,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},28453(e,i,n){n.d(i,{R:()=>t,x:()=>o});var a=n(96540);let r={},s=a.createContext(r);function t(e){let i=a.useContext(s);return a.useMemo(function(){return"function"==typeof e?e(i):{...i,...e}},[i,e])}function o(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:t(e.components),a.createElement(s.Provider,{value:i},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.