f10fd61efd
Summary: hg-crew's c27dc3c3122 and c27dc3c3122^ were breaking our extensions: ``` $ hg log -r c27dc3c3122^ changeset: 9010734b79911d2d2e7405d91a4df479b35b3841 user: Augie Fackler <raf@durin42.com> date: Thu, 09 Jun 2016 21:12:33 -0700 s.ummary: cleanup: replace uses of util.(md5|sha1|sha256|sha512) with hashlib.\1 ``` ``` $ hg log -r c27dc3c3122 changeset: 0d55a7b8d07bf948c935822e6eea85b044383f00 user: Augie Fackler <raf@durin42.com> date: Thu, 09 Jun 2016 21:13:23 -0700 s.ummary: util: drop local aliases for md5, sha1, sha256, and sha512 ``` I did a grep over facebook-hg-rpms to see what was affected: ``` $ grep "util.\(md5\|sha1\|sha256\|sha512\)" -r ~/facebook-hg-rpms /home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/basestore.py: sha = util.sha1(filename).digest() /home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/basestore.py: sha = util.sha1(filename).digest() /home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/shallowutil.py: pathhash = util.sha1(file).hexdigest() /home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/shallowutil.py: pathhash = util.sha1(file).hexdigest() /home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/debugcommands.py: filekey = util.sha1(file).hexdigest() /home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/historypack.py: namehash = util.sha1(name).digest() /home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/historypack.py: node = util.sha1(filename).digest() /home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/historypack.py: files = ((util.sha1(filename).digest(), offset, size) /home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/fileserverclient.py: pathhash = util.sha1(file).hexdigest() /home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/fileserverclient.py: pathhash = util.sha1(file).hexdigest() /home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/basepack.py: self.sha = util.sha1() /home/jeroenv/facebook-hg-rpms/remotefilelog/tests/test-datapack.py: return util.sha1(content).digest() /home/jeroenv/facebook-hg-rpms/remotefilelog/tests/test-histpack.py: return util.sha1(content).digest() Binary file /home/jeroenv/facebook-hg-rpms/hg-crew/.hg/store/data/mercurial/revlog.py.i matches Binary file /home/jeroenv/facebook-hg-rpms/hg-crew/.hg/store/data/contrib/mercurial.spec.i matches /home/jeroenv/facebook-hg-rpms/hg-crew/contrib/mercurial.spec:%global docutilsmd5 4622263b62c5c771c03502afa3157768 /home/jeroenv/facebook-hg-rpms/hg-crew/contrib/buildrpm: DOCUTILSMD5=`sed -ne "s/^%global docutilsmd5 //p" $specfile` /home/jeroenv/facebook-hg-rpms/fb-hgext/sparse.py: return util.sha1(fh.read()).hexdigest() /home/jeroenv/facebook-hg-rpms/fb-hgext/sparse.py: sha1 = util.sha1() /home/jeroenv/facebook-hg-rpms/fb-hgext/sparse.py: sha1 = util.sha1() /home/jeroenv/facebook-hg-rpms/fb-hgext/sparse.py: sha1 = util.sha1() /home/jeroenv/facebook-hg-rpms/fb-hgext/sparse.py: sha1 = util.sha1() /home/jeroenv/facebook-hg-rpms/mutable-history/hgext/simple4server.py: sha = util.sha1() /home/jeroenv/facebook-hg-rpms/mutable-history/hgext/evolve.py: sha = util.sha1() ``` This diff is part of the fix. Test Plan: Ran the tests. ``` $MERCURIALRUNTEST -S -j 48 --with-hg ~/local/facebook-hg-rpms/hg-crew/hg ``` There was still one failure, but that's due to the fact that my locally built hg does not have lz4revlog. Reviewers: #sourcecontrol, durham, ttung Reviewed By: ttung Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D3438597 Tasks: 11762191 Signature: t1:3438597:1466016473:d33de5a2c772d17724429d3607e2400c85618c71 |
||
---|---|---|
cfastmanifest | ||
fastmanifest | ||
phabricator | ||
scripts | ||
sqldirstate | ||
tests | ||
.editorconfig | ||
.hgignore | ||
arcdiff.py | ||
backups.py | ||
bundle2hooks.py | ||
catnotate.py | ||
cfastmanifest.c | ||
chistedit.py | ||
commitextras.py | ||
COPYING | ||
dirsync.py | ||
errorredirect.py | ||
extorder.py | ||
extutil.py | ||
fbamend.py | ||
fbconduit.py | ||
fbhistedit.py | ||
githelp.py | ||
gitlookup.py | ||
gitrevset.py | ||
grepdiff.py | ||
inhibitwarn.py | ||
Makefile | ||
mergedriver.py | ||
morestatus.py | ||
patchpython.py | ||
perftweaks.py | ||
phabdiff.py | ||
phabstatus.py | ||
phrevset.py | ||
pullcreatemarkers.py | ||
pushrebase.py | ||
pushvars.py | ||
rage.py | ||
README.md | ||
reflog.py | ||
reset.py | ||
sampling.py | ||
setup.py | ||
show.py | ||
simplecache.py | ||
smartlog.py | ||
sparse.py | ||
statprof.py | ||
statprofext.py | ||
tweakdefaults.py | ||
upgradegeneraldelta.py |
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.
Note that there will be extensions included here that only work with Facebook's infrastructure; they are included to give you an idea of how we integrate mercurial with our workflows.
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.
chistedit
An interactive ncurses interface to histedit.
NOTE: This requires python-curses installed and Mercurial's histedit extension enabled.
This extensions allows you to interactively move around changesets or change the action to perform while keeping track of possible conflicts.
upgradegeneraldelta
Upgrades manifests to generaldelta in-place, without needing to reclone.
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.