A Scalable, User-Friendly Source Control System.
Go to file
Durham Goode 9962f55805 gitrevset: hide ssh warnings
Summary:
sshing to the hg server could result in stdout containing 'remote: ...' (like if
the user had an extension enabled that wasn't on the server). This interefered
with fbmake being able to parse the git hash and broke fbmake for people with
such configs.

The fix is to redirect it to stderr instead.  I tried using ui.push/popbuffer
but it doesn't actually work because the ui that is being used is newly
constructed as part of the peer being created, and therefore doesn't respect the
buffer stack. I also tried ui.quiet=True, but that also failed, as newly created
ui's don't inherit the original quiet value, but instead look at the main
config['quiet'].

Test Plan:
Added a bogus extension to my ~/.hgrc

    hh log -r 1095d3a297300405f679826fc78d52c8a6c1da85 -T '{gitnode}\n' 2>/dev/null
    hh log -r g988fa44ff4bebf4093b09ef27b5e24702ebda6ab 2>/dev/null

Verified there was no 'remote:' output.

Reviewers: sid0, mpm, pyd

Differential Revision: https://phabricator.fb.com/D1604547
2014-10-08 16:48:59 -07:00
crecord Update crecord extension 2014-07-14 18:52:11 -07:00
fb_share_bookmarks Adds a wip extension to share bookmarks at FB 2014-09-08 10:28:33 -07:00
tests [tweakdefaults] superpower grep 2014-09-25 13:50:36 -07:00
.hgignore Add gitrevset support. 2014-09-08 15:36:12 -07:00
backups.py Fix time import in backups 2014-07-24 15:03:53 -07:00
COPYING Initial commit with extensions and readme 2014-06-02 12:54:54 -07:00
fbamend.py fbamend: auto-disable when evolution is enabled 2014-06-11 22:34:21 -07:00
githelp.py Updated the githelp command to reflect wgrep and grep swap 2014-09-24 16:29:04 -07:00
gitlookup.py [gitlookup] fix compatibility with Mercurial 3.2 2014-09-17 16:40:37 -07:00
gitrevset.py gitrevset: hide ssh warnings 2014-10-08 16:48:59 -07:00
Makefile Initial commit: fbamend, smartlog 2013-06-20 12:16:36 -07:00
phrevset.py [phrevset] Add ability to parse git revisions from Phabricator 2014-07-24 20:27:05 -07:00
README.md Initial commit with extensions and readme 2014-06-02 12:54:54 -07:00
setup.py Add gitrevset support. 2014-09-08 15:36:12 -07:00
smartlog.py smartlog: simplify the coloration code with a list compression 2014-06-10 16:53:53 -07:00
tweakdefaults.py [grep] ignore symlinks 2014-09-30 16:37:32 -07:00

hg-experimental

This is a collection of proof-of-concept Mercurial extensions written at Facebook. While they are all in basic use, they are considered experimental, are unsupported, and may or may not receive updates in the future. We're making them open source as examples of some better workflows we've been experimenting with.

smartlog

An extension that adds the 'hg smartlog' command. It prints graph log output containing only the commits relevant to yourself. Shows your bookmarks, the @ or master bookmark, and any draft commits without bookmarks that you've made within the past 2 weeks. Any commits in the graph that are skipped are represented by '...'.

We recommend also having an 'hg sl' alias that gives more concise output:

alias.sl=smartlog --template "{shortest(node)}  {author|user}  {bookmarks % '{ifeq(bookmark, current, label(\"yellow\", \" {bookmark}*\"), label(\"green\", \" {bookmark}\"))}'} {ifeq(branch, 'default', '', label(\"bold\", branch))}\n{desc|firstline}\n\n"

githelp

An extension that adds the 'hg githelp' command. It translates Git commands into Mercurial commands. Example:

$ hg githelp -- git rebase origin/master
  hg rebase -d master

$ hg githelp -- reset --hard HEAD^
  hg strip -r .

So it acts as a useful cheat sheet tool for people moving from Git to Mercurial.

backups

An extension that adds the 'hg backups' command. 'hg backups' prints a list of recently deleted commits (by reading your .hg/strip-backups directory) and allows you to recover a commit by doing 'hg backups --recover '. It prints the missing commits in reverse chronological order, and acts as a pseudo-replacement for Git's reflog.

fbamend

An extension that adds the 'hg amend --rebase' command. When working with a stack of commits, it's currently impossible to amend a commit in the middle of the stack. This extension enables that ability, adds a 'hg amend' command that invokes 'hg commit --amend', and adds a --rebase flag to 'hg amend --rebase' that rebase all the children of the commit onto the newly amended version.

If 'hg amend' is run on a commit in the middle of a stack without using --rebase, the amend succeeds and the old version of the commit is left behind with a marker bookmark on it 'bookmarkname(preamend)'. The user can then run 'hg amend --fixup' to post-humously rebase the children onto the new version of the commit.

Contributing

Patches are welcome as pull requests, though they will be collapsed and rebased to maintain a linear history.

We (Facebook) have to ask for a "Contributor License Agreement" from someone who sends in a patch or code that we want to include in the codebase. This is a legal requirement; a similar situation applies to Apache and other ASF projects.

If we ask you to fill out a CLA we'll direct you to our online CLA page where you can complete it easily. We use the same form as the Apache CLA so that friction is minimal.

License

These extensions are made available under the terms of the GNU General Public License version 2, or any later version. See the COPYING file that accompanies this distribution for the full text of the license.