SlideShare a Scribd company logo
42qu.com , 找到给你答案的人




42qu.com
42qu.com , 找到给你答案的人




Python 网站开发 入门班

基于 新浪 SAE 和 Python Torando 的搭建短网址应用

第三课 Hg 的用法

郭浩川

• wooparadog.42qu.com

• guohaochuan@gmail.com
42qu.com , 找到给你答案的人


Mercurial(Hg)
• BitKeeper, stopped free version.

• Linux kernel needed an alternative.

• Linus Torvalds made git.

• Mackall built Mercurial
42qu.com , 找到给你答案的人


Who is using
•   Python
•   Vim
•   W3C
•   RabbitMQ
•   OpenJDK
•   Go Programing language
•   Mozilla
•   豆瓣
42qu.com , 找到给你答案的人


Host servives
•   Bitbucket
•   Google Code
•   SourceForge
•   CodePlex
42qu.com , 找到给你答案的人


So what is Hg
42qu.com , 找到给你答案的人



The svn model:
Central Version Control System(CVS) or client – server



•   Everything is on one server.
•   Devs commit to that server.
•   Need network connection.
•   Work flow:
    copy trunk -> dev in branch -> copy
    another trunk -> merge your branch ->
    merge to trunk
42qu.com , 找到给你答案的人

The hg model:
Distributed Version Control System(DVCS) peer to peer


•   Many Repositories.
•   Devs commit to his local repo
•   Exchange patches.
•   Many development models.
    Develop/Release:
    Fork/branch release  develop in branch
     [Merge trunk  trunk merge branch |
    trunk merge branch]
42qu.com , 找到给你答案的人


Usage
• Command line tool
  – Hg <command> <params>


• Common commands:
  – clone commit push pull diff branches branch
    merge update rm forget help
42qu.com , 找到给你答案的人


Gui Tools
• Windows:
  – Tortoisehg:
    http://tortoisehg.bitbucket.org/


• Linux:
  – hgtk
42qu.com , 找到给你答案的人


Configuration ( 工欲善其事 , 必先利其器 )
• .hgrc
  – [ui]
     • username = wooparadog <guohaochuan@gmial.com>
     • Ssh = ssh –i ~/.ssh/id_rsa -C
     • Ignore = ~/.hgignore
  – [Extensions]
     • Hgext.fetch =
     • Color =
  – [Alias]
     • blame = annotate --user --number
42qu.com , 找到给你答案的人
42qu.com , 找到给你答案的人
42qu.com , 找到给你答案的人


So let’s do a walk through
•   Use bitbucket as project hoster
•   3 people involved.
•   Use release/develop model
•   Include:
    – Build reop
    – Build branches
    – Resolve conficts
42qu.com , 找到给你答案的人


Release/develop model:
• First commit to default branch. This is our
  release branch.
• All other features/bugfixes etc. will be in
  another branch.
• When they are ready(for production),
  merge them to default(release branch)
42qu.com , 找到给你答案的人


Make a repo in bitbucket
42qu.com , 找到给你答案的人


 Clone it down.
hg clone ssh://hg@bitbucket.org/wooparadog/42qu-test




 .hg exists and exists only in repo root , in contrast to svn
42qu.com , 找到给你答案的人


Add files ( This is done by DevA)
                            After some coding…

                            3.Check what’s changed
                            4.Add new file. (or add all files)
                            5.Check status again.

                            Code is not committed at this
                            stage.
42qu.com , 找到给你答案的人


Commit and push
42qu.com , 找到给你答案的人


DevB wants to work.
• Clone it down from bitbucket.
• Make a branch.
  What branches are there?




  Make a new branch, commit after braching, check current branch
42qu.com , 找到给你答案的人


DevB does some work…
He decides some folders were badly named.
So he uses hg mv to rename them
And some files can be deleted.
So he uses hg rm to remove them
Now repo looks like this.



Then he rages at a block of code.
He wants to know who wrote them
hg blame shows it was all DevA’s work.
42qu.com , 找到给你答案的人


Then DevB’s work is done.
• He uses hg status to see what’s changed
• Then reviews his changes with hg diff
  before committing to his branch.
  – Push should be: hg push --new-branch
42qu.com , 找到给你答案的人


DevC
• Boss thinks DevB’s progress is too slow.
  DevC comes to save the day.
• He cloned the repo, switch to DevB’s
  branch by
       hg update wooparadog_20120310_new_feature

• Then he starts doing stuff…With DevB
  doing his on his computer….
42qu.com , 找到给你答案的人


Conflicts
• When devC wants to push.



• Branch at bitbucket has changed. He
  needs to pull.
42qu.com , 找到给你答案的人


Resolving conflicts
• hg resolve -l
• Use ack to find conflicts.

• And resolve it ( hg resolve -m)




                         Don‘t forget to commit and push it..
42qu.com , 找到给你答案的人


Revert
• DevB pulls new version, after some time,
  he hates what devC has done.
• Check log.
  – hg log -b <branch>
  – hg log -b .
• Revert to version 5.
• hg revert –r 5
42qu.com , 找到给你答案的人


Merge to release
• DevA now thinks it’s ready to make this
  feature online. But first, he needs to
  review all the changes.
  hg diff –r <revision>:<revision>
• What we would do:
  hg update default
  hg merge <branch>
  hg diff
42qu.com , 找到给你答案的人


Conclusion:
•   Add      •   Merge
•   Commit   •   Resolve
•   Push     •   Status
•   Pull     •   Rm
•   Update   •   Mv
•   Diff
•   Log

                     ‘commit’ can be ‘com’, yeah, git, beat thath.
42qu.com , 找到给你答案的人


Last,
• Hggit
  – hg clone git://github.com/schacon/munger.git

• Hgsvn/hgsubversion
42qu.com , 找到给你答案的人


Naming revision
• hg tag
  – hg tag –r <revision> <name>
• hg tags
• Update:
  – hg update <tag_name>
42qu.com , 找到给你答案的人
42qu.com , 找到给你答案的人


References:
•   http://book.42qu.com/tool/hg.html
     –   Hg 工作流介绍
     –   Pythonic Hg 使用
     –   了解分布式版本管理系统
     –   Mercurial CheatSheet
     –   Mercurial 权威指南
     –   Mercurial: The Definitive Guide
     –   Hg Init: a Mercurial tutorial
     –   Hg Git
     –   Hg Svn
     –   Hg 小技巧
     –   Hg & Git 口水战文章
           • Git 和 Hg 面对面
           • Git 和 Hg 面對面之我見 - Willie Wu

More Related Content

What's hot

Containers Roadshow: How to Develop Containers for the Enterprise
Containers Roadshow: How to Develop Containers for the EnterpriseContainers Roadshow: How to Develop Containers for the Enterprise
Containers Roadshow: How to Develop Containers for the Enterprise
Honza Horák
 
Docker for PHP Developers - Madison PHP 2017
Docker for PHP Developers - Madison PHP 2017Docker for PHP Developers - Madison PHP 2017
Docker for PHP Developers - Madison PHP 2017
Chris Tankersley
 
From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017
Chris Tankersley
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
CodeOps Technologies LLP
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
Roman Podoliaka
 
Codifying the Build and Release Process with a Jenkins Pipeline Shared Library
Codifying the Build and Release Process with a Jenkins Pipeline Shared LibraryCodifying the Build and Release Process with a Jenkins Pipeline Shared Library
Codifying the Build and Release Process with a Jenkins Pipeline Shared Library
Alvin Huang
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
Kazuho Oku
 
Docker, Docker Swarm mangement tool - Gorae
Docker, Docker Swarm mangement tool - GoraeDocker, Docker Swarm mangement tool - Gorae
Docker, Docker Swarm mangement tool - Gorae
Rhio kim
 
Mercurial Tutorial
Mercurial TutorialMercurial Tutorial
Mercurial Tutorial
Adam Pah
 
Docker basic
Docker basicDocker basic
Docker basic
Somenath Ghosh
 
Build optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerBuild optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and Docker
Dmytro Patkovskyi
 
Docker
DockerDocker
Docker
Cary Gordon
 
Drupal in Libraries
Drupal in LibrariesDrupal in Libraries
Drupal in Libraries
Cary Gordon
 
DocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldDocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM World
Schalk Cronjé
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
Clark Everetts
 
How to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rbHow to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rb
Hiroshi SHIBATA
 
CI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins PipelineCI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins Pipeline
Veaceslav Gaidarji
 
Kubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanKubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with Podman
Mihai Criveti
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard way
Hiroshi SHIBATA
 
Docker & ci
Docker & ciDocker & ci
Docker & ci
Patxi Gortázar
 

What's hot (20)

Containers Roadshow: How to Develop Containers for the Enterprise
Containers Roadshow: How to Develop Containers for the EnterpriseContainers Roadshow: How to Develop Containers for the Enterprise
Containers Roadshow: How to Develop Containers for the Enterprise
 
Docker for PHP Developers - Madison PHP 2017
Docker for PHP Developers - Madison PHP 2017Docker for PHP Developers - Madison PHP 2017
Docker for PHP Developers - Madison PHP 2017
 
From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
 
Codifying the Build and Release Process with a Jenkins Pipeline Shared Library
Codifying the Build and Release Process with a Jenkins Pipeline Shared LibraryCodifying the Build and Release Process with a Jenkins Pipeline Shared Library
Codifying the Build and Release Process with a Jenkins Pipeline Shared Library
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
 
Docker, Docker Swarm mangement tool - Gorae
Docker, Docker Swarm mangement tool - GoraeDocker, Docker Swarm mangement tool - Gorae
Docker, Docker Swarm mangement tool - Gorae
 
Mercurial Tutorial
Mercurial TutorialMercurial Tutorial
Mercurial Tutorial
 
Docker basic
Docker basicDocker basic
Docker basic
 
Build optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerBuild optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and Docker
 
Docker
DockerDocker
Docker
 
Drupal in Libraries
Drupal in LibrariesDrupal in Libraries
Drupal in Libraries
 
DocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldDocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM World
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
 
How to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rbHow to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rb
 
CI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins PipelineCI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins Pipeline
 
Kubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanKubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with Podman
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard way
 
Docker & ci
Docker & ciDocker & ci
Docker & ci
 

Similar to Using Hg

git and github
git and githubgit and github
git and github
Darren Oakley
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
Derek Jacoby
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
Derek Jacoby
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014
Mandi Walls
 
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
Po-Jen Lai
 
Intro. to Git and Github
Intro. to Git and GithubIntro. to Git and Github
Intro. to Git and Github
Olmo F. Maldonado
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
Pantheon
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
PouriaQashqai1
 
Github basics
Github basicsGithub basics
Github basics
Radoslav Georgiev
 
Demo
DemoDemo
Groovy there's a docker in my application pipeline
Groovy there's a docker in my application pipelineGroovy there's a docker in my application pipeline
Groovy there's a docker in my application pipeline
Kris Buytaert
 
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert
NETWAYS
 
Git Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsGit Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential Commands
Jeremy Lindblom
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
 
Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
JBUG London
 
Hg for bioinformatics, second part
Hg for bioinformatics, second partHg for bioinformatics, second part
Hg for bioinformatics, second part
Giovanni Marco Dall'Olio
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
Geoff Hoffman
 
Introduction To Docker
Introduction To DockerIntroduction To Docker
Introduction To Docker
Hamilton Turner
 
R meetup 20161011v2
R meetup 20161011v2R meetup 20161011v2
R meetup 20161011v2
Niels Ole Dam
 
Git Going With DVCS v1.5.2
Git Going With DVCS v1.5.2Git Going With DVCS v1.5.2
Git Going With DVCS v1.5.2
Matthew McCullough
 

Similar to Using Hg (20)

git and github
git and githubgit and github
git and github
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014
 
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
 
Intro. to Git and Github
Intro. to Git and GithubIntro. to Git and Github
Intro. to Git and Github
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
Github basics
Github basicsGithub basics
Github basics
 
Demo
DemoDemo
Demo
 
Groovy there's a docker in my application pipeline
Groovy there's a docker in my application pipelineGroovy there's a docker in my application pipeline
Groovy there's a docker in my application pipeline
 
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert
 
Git Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsGit Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential Commands
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
 
Hg for bioinformatics, second part
Hg for bioinformatics, second partHg for bioinformatics, second part
Hg for bioinformatics, second part
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Introduction To Docker
Introduction To DockerIntroduction To Docker
Introduction To Docker
 
R meetup 20161011v2
R meetup 20161011v2R meetup 20161011v2
R meetup 20161011v2
 
Git Going With DVCS v1.5.2
Git Going With DVCS v1.5.2Git Going With DVCS v1.5.2
Git Going With DVCS v1.5.2
 

Recently uploaded

Aggression - Applied Social Psychology - Psychology SuperNotes
Aggression - Applied Social Psychology - Psychology SuperNotesAggression - Applied Social Psychology - Psychology SuperNotes
Aggression - Applied Social Psychology - Psychology SuperNotes
PsychoTech Services
 
The Six Working Genius Short Explanation
The Six Working Genius Short ExplanationThe Six Working Genius Short Explanation
The Six Working Genius Short Explanation
abijabar2
 
Understanding of Self - Applied Social Psychology - Psychology SuperNotes
Understanding of Self - Applied Social Psychology - Psychology SuperNotesUnderstanding of Self - Applied Social Psychology - Psychology SuperNotes
Understanding of Self - Applied Social Psychology - Psychology SuperNotes
PsychoTech Services
 
aula open english sobre Classic-motorcycles-2_1.pdf
aula open english sobre Classic-motorcycles-2_1.pdfaula open english sobre Classic-motorcycles-2_1.pdf
aula open english sobre Classic-motorcycles-2_1.pdf
PauloVictor90882
 
Strategies to rekindle the fire inside you and stay motivated.pdf
Strategies to rekindle the fire inside you and stay motivated.pdfStrategies to rekindle the fire inside you and stay motivated.pdf
Strategies to rekindle the fire inside you and stay motivated.pdf
Million-$-Knowledge {Million Dollar Knowledge}
 
The Secret Warrior - Help Share a Parent or Loved Ones’ Cancer Diagnosis with...
The Secret Warrior - Help Share a Parent or Loved Ones’ Cancer Diagnosis with...The Secret Warrior - Help Share a Parent or Loved Ones’ Cancer Diagnosis with...
The Secret Warrior - Help Share a Parent or Loved Ones’ Cancer Diagnosis with...
CANSA The Cancer Association of South Africa
 
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotesProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
PsychoTech Services
 
Best Way to Overcome Procrastination and Increase Productivity.pdf
Best Way to Overcome Procrastination and Increase Productivity.pdfBest Way to Overcome Procrastination and Increase Productivity.pdf
Best Way to Overcome Procrastination and Increase Productivity.pdf
Million-$-Knowledge {Million Dollar Knowledge}
 

Recently uploaded (8)

Aggression - Applied Social Psychology - Psychology SuperNotes
Aggression - Applied Social Psychology - Psychology SuperNotesAggression - Applied Social Psychology - Psychology SuperNotes
Aggression - Applied Social Psychology - Psychology SuperNotes
 
The Six Working Genius Short Explanation
The Six Working Genius Short ExplanationThe Six Working Genius Short Explanation
The Six Working Genius Short Explanation
 
Understanding of Self - Applied Social Psychology - Psychology SuperNotes
Understanding of Self - Applied Social Psychology - Psychology SuperNotesUnderstanding of Self - Applied Social Psychology - Psychology SuperNotes
Understanding of Self - Applied Social Psychology - Psychology SuperNotes
 
aula open english sobre Classic-motorcycles-2_1.pdf
aula open english sobre Classic-motorcycles-2_1.pdfaula open english sobre Classic-motorcycles-2_1.pdf
aula open english sobre Classic-motorcycles-2_1.pdf
 
Strategies to rekindle the fire inside you and stay motivated.pdf
Strategies to rekindle the fire inside you and stay motivated.pdfStrategies to rekindle the fire inside you and stay motivated.pdf
Strategies to rekindle the fire inside you and stay motivated.pdf
 
The Secret Warrior - Help Share a Parent or Loved Ones’ Cancer Diagnosis with...
The Secret Warrior - Help Share a Parent or Loved Ones’ Cancer Diagnosis with...The Secret Warrior - Help Share a Parent or Loved Ones’ Cancer Diagnosis with...
The Secret Warrior - Help Share a Parent or Loved Ones’ Cancer Diagnosis with...
 
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotesProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
 
Best Way to Overcome Procrastination and Increase Productivity.pdf
Best Way to Overcome Procrastination and Increase Productivity.pdfBest Way to Overcome Procrastination and Increase Productivity.pdf
Best Way to Overcome Procrastination and Increase Productivity.pdf
 

Using Hg

Editor's Notes

  1. 版本控制( Revision control )是维护工程蓝图的标准作法,能追踪工程蓝图从诞生一直到定案的过程。此外,版本控制也是一种软件工程技巧,借此能在软件开发的过程中,确保由不同人所编辑的同一程式档案都得到同步。 1) 版本控制工程技巧,在开发的过程中,确保由不同人所编辑的同一档案都得到更新 . 2) 返回到各个文件以前的修订版本,还可以比较任意两个版本以查看它们之间的变化 . (revert and diff) 3) 版本控制可以保留一个文件修订的可检索的准确历史日志 . (for review/blame...etc)
  2. 1. 所有版本控制的工作在一个服务器进行,由中央权威管理存取权限“锁上”档案库中的档案,一次只让一个开发者工作。 2.(wiki) 或者使用合并模式 , 每次检查 repo 和本地的版本 , 如果版本低 , 则停止 commit, 要求用户 update 到最新地址 , 如果有冲突 , 则 resolve 后再允许提交 .
  3. 每人都有其 本地沙盒 (local sandbox). 你可以在自己的工作空间中修改或恢复旧版 , 不需要大量的检入 (checkins). 你自己的工作记录都累积存在自己的 仓库 repository. 可离线工作 . 只有当你想分享修订时才需要上线 . 否则可一直在自己的工作机上独立作业 / 签入 (check in)/ 复原 (undo), 没有所谓 &amp;quot; 服务器 &amp;quot; 当掉或在飞机上的问题 . 速度很快 . 差异 (diff), 提交 (commit) 与恢复 (revert) 都在本端即可完成 . 没有因网络或服务器不稳而必须用一年前开发版本的问题 . 可妥善做变动的处理 . DVCS 针对分享的变更做建置 . 每个变更都有其独一无二的辨识码 (guids) 以方便追踪 . 分支 (Branching) 与合并 (merging) 很容易 . 因为每一开发人员 &amp;quot; 有自己的分支 &amp;quot;, 每一分享的变动就像交换整合 . 但 guids 让自动组合变更与避免重复动作简单容易 .
  4. Help