Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Commit

Permalink
Update hg version to 4.2.1. Fixes bug 1374644.
Browse files Browse the repository at this point in the history
Make hg extension compatible with hg 4.2.1. Follow the (weird, pathologically introspective, scribbly-on-globals) idiom from https://www.mercurial-scm.org/wiki/WritingExtensions#Command_table. The @command decorator fills in the attrs of the function that hg is expecting and throwing AttributeErrors over.

Update hglib while we're at it.
  • Loading branch information
erikrose committed Jun 21, 2017
1 parent 7e42042 commit 323c496
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
14 changes: 10 additions & 4 deletions dxr/hgext/previous_revisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


from mercurial import cmdutil


cmdtable = {}
command = cmdutil.command(cmdtable)


@command('previous-revisions', [])
def previous_revisions(ui, repo, **opts):
"""Print the last node@date@file in which each file changed."""
last_change = {}
Expand All @@ -30,8 +38,6 @@ def previous_revisions(ui, repo, **opts):
for filename, (node, date) in last_change.iteritems():
ui.write('%s@%s@%s\n' % (node, date, filename))

cmdtable = {
'previous-revisions': (previous_revisions, [], '')
}

testedwith = '3.4'
testedwith = '4.2.1'
minimumhgversion = '1.9' # not tested with 1.9, but this is where @command was introduced
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ Jinja2==2.7.3
# sha256: pOwa_1m5WhS0XrLiN2GgF56YMZ2lp-t2tW6ozce4ccM
MarkupSafe==0.23

# sha256: 3MkOSoR2FJ7MivE8CCAoYLTJyYepTE88GLKClLb9js0
Mercurial==3.4.2
# sha256: 19VXL1qgeX-_IWhEDqpRFJ34hkX-N6-LFfpmDZqBWKA
Mercurial==4.2.1

# sha256: k-YuBcetPaGiM972cx6ChRVnAeNBml_ieQF8Qp7GfOA
more-itertools==2.2
Expand Down Expand Up @@ -89,5 +89,5 @@ xpidl==1.0
# sha256: FWvz7Ce6nsfgz4--AoCHGAmdIY3kA-tkpxTXO6GimrE
requests==1.2.3

# sha256: DcCH0Vt3TNqC08gJb7DlFMrrLdtg7tOOkFaxbiebo8U
python-hglib==1.7
# sha256: aT1u2SplZueIAsegPCVs2jPQjGOtPwD8-hE3mxhLlGI
python-hglib==2.4

0 comments on commit 323c496

Please sign in to comment.