A Guide to Branching in Mercurial

2024-03-14 00:58
文章标签 guide mercurial branching

本文主要是介绍A Guide to Branching in Mercurial,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

原文地址:http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/

 

Branching with Named Branches

The third way of branching is to use Mercurial’s named branches. Some people prefer this method (myself included) and many others don’t.

To create a new named branch:

$ cd ~/src/test-project
$ hg branch feature

When you commit the newly created changeset will be on the same branch as its parent, unless you’ve used hg branch to mark it as being on a different one.

Using a branch name to specify a revision is shorthand for “the tip changeset of this named branch”. In this example repository:

  • Running hg update default would update to changeset 3, which is the tip of  the default branch.
  • Running hg update feature would update to changeset 4, which is the tip of  the feature branch.

In the past there was also the problem of not having a way to “close” a branch, which means that over time the list of branches could get huge. This was fixed in Mercurial 1.2 which introduced the --close-branch option forhg commit.

Mercurial will push/pull all branches by default, while git will push/pull only the current branch.

This is important if you’re a git user working with Mercurial. If you want to push/pull only a single branch with Mercurial you can use the --rev option (-r for short) and specify the tip revision of the branch:

$ hg push --rev branchname
$ hg push --rev bookmarkname
$ hg push --rev 4

If you specify a revision, Mercurial will push that changeset and any ancestors of it that the target doesn’t already have.

 

这篇关于A Guide to Branching in Mercurial的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/806779

相关文章

Illustrated Guide to Monitoring and Tuning the Linux Networking Stack: Receiving Data

太长不读(TL; DR) 这篇文章用一系列图表扩展了以前的博客文章Monitoring and Tuning the Linux Networking Stack: Receiving Data,旨在帮助读者形成一个更清晰的视野来了解Linux网络协议栈是如何工作的 在监控或调优 Linux 网络协议栈试没有捷径可走。如果你希望调整或优化每个组件及其相互作用,你就必须努力充分了解它们。也就是说

四足机器人控制算法——建模、控制与实践(unitree_guide配置)

目录 官方文档 unitree_guide 1. 快捷指令 2. ROS安装 3. LCM库安装 3.1. 安装步骤 4. pthread库 5. 工程文件下载 6. 编译 报错: 报错1 报错2: 报错3 其他报错 7. 运行 7.1. 运行 Gazebo 仿真环境 7.2. 启动控制器 8. 简单使用 官方文档 宇树科技 文档中心 四足机器人算法实

Cisco 2500 Series Access Server User Guide开头

读到Preparing to Install the Cisco 2500 Series Access Server 2-3

【Git之窗】(六)A successful Git branching model

先放链接:http://nvie.com/posts/a-successful-git-branching-model/    原文作者Vincent Driessen,同时国内CSDN极客头条的翻译后的链接:“http://geek.csdn.net/news/detail/67321”,绝对的好文,转发给需要的朋友们。             在这篇文章中介绍的

UVA10099 - The Tourist Guide(floyd + 最小值的最大化)

UVA10099 - The Tourist Guide(floyd + 最小值的最大化)  UVA10099 - The Tourist Guide 题目大意:  给一无向图,图上的点代表城市,边代表路,每条边上的权值代表的是这条路上的巴士的最大乘客数,作为导游,给定起点和终点,和负责的游客,问需要的最少的趟数可以将这个游客送到终点。 解题思路:  路径上最小值的最大化。减少趟数,

ORACLE SQL*Plus® User's Guide and Reference

SQL*Plus® User's Guide and Reference http://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12014.htm

Apple - Media Playback Programming Guide

本文翻译整理自:Media Playback Programming Guide(Updated: 2018-01-16 https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/MediaPlaybackGuide/Contents/Resources/en.lproj/Introduction

Apple - Cocoa Event Handling Guide

本文翻译整理自:Cocoa Event Handling Guide( https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/Introduction/Introduction.html#//apple_ref/doc/uid/10000060i 文章目录 一、导

【Hadoop】Flume官方文档翻译——Flume 1.7.0 User Guide (unreleased version)中一些知识点

Flume官方文档翻译——Flume 1.7.0 User Guide (unreleased version)(一) Flume官方文档翻译——Flume 1.7.0 User Guide (unreleased version)(二) Flume Properties Property Name Default  Description flume.called

【Hadoop】Flume官方文档翻译——Flume 1.7.0 User Guide (unreleased version)(二)

Flume官方文档翻译——Flume 1.7.0 User Guide (unreleased version)(一) Logging raw data(记录原始数据) Logging the raw stream of data flowing through the ingest pipeline is not desired behaviour in many production