Jun's Blog

Output, activities, memo and etc.

Sending pull-request to Mercurial repository

A way to send pull-request to Git repository is deeply in my mind and body.

In case of git repo. I would show this as a comparison of Marcurial repo.

$ git clone <repo url>
$ git remote add junaruga <forked repo url>
$ git checkout -b feature/foo
$ vi something
$ git add something
$ git commit
$ git push junaruga feature/foo

In case of marcurial repo. It's so hard!

$ hg clone https://junaruga@bitbucket.org/ged/ruby-pg

$ cd ruby-pg

$ hg update <latest_commit on master> # Maybe there is a better way for this command.

$ vi .hg/hgrc
...
[paths]
default = https://junaruga@bitbucket.org/ged/ruby-pg
junaruga = https://junaruga@bitbucket.org/junaruga/ruby-pg <- forked repo
...

$ hg branch feature/add-ruby-2.5 # Create new branch. Note that the branch information is included in later commit information.

$ vi .travis.yml # Edit something.

$ hg status
M .travis.yml

$ hg diff

$ hg commit

$ hg log

$ hg push -b feature/add-ruby-2.5 --new-branch junaruga