sapling/edenscm/hgext/phrevset.py

322 lines
10 KiB
Python
Raw Normal View History

[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
# phrevset.py - support for Phabricator revsets
#
# Copyright 2013 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""provides support for Phabricator revsets
Allows for queries such as `hg log -r D1234567` to find the commit which
corresponds to a specific Differential revision.
Automatically handles commits already in subversion, or whose hash has
changed since submitting to Differential (due to amends or rebasing).
Requires arcanist to be installed and properly configured.
Repositories should include a callsign in their hgrc.
Example for www:
[phrevset]
callsign = E
"""
import json
import os
import re
import signal
import threading
from edenscm.mercurial import error, hg, namespaces, pycompat, registrar, util
from edenscm.mercurial.i18n import _
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
from .extlib.phabricator import arcconfig, diffprops, graphql
try:
from hgsubversion import util as svnutil
except ImportError:
svnutil = None
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
configtable = {}
configitem = registrar.configitem(configtable)
configitem("phrevset", "callsign", default=None)
namespacepredicate = registrar.namespacepredicate()
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
DIFFERENTIAL_REGEX = re.compile(
"Differential Revision: http.+?/" # Line start, URL
"D(?P<id>[0-9]+)", # Differential ID, just numeric part
flags=re.LOCALE,
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
)
DESCRIPTION_REGEX = re.compile(
"Commit r" # Prefix
"(?P<callsign>[A-Z]{1,})" # Callsign
"(?P<id>[a-f0-9]+)", # rev
flags=re.LOCALE,
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
)
def getdiff(repo, diffid):
"""Resolves a phabricator Diff number to a commit hash of it's latest version """
timeout = repo.ui.configint("ssl", "timeout", 5)
ca_certs = repo.ui.configpath("web", "cacerts")
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
try:
client = graphql.Client(
repodir=pycompat.getcwd(), ca_bundle=ca_certs, repo=repo
)
return client.getdifflatestversion(timeout, diffid)
except Exception as e:
raise error.Abort("Could not not call phabricator graphql API: %s" % e)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
def finddiff(repo, diffid, querythread=None):
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
"""Scans the changelog for commit lines mentioning the Differential ID
If the optional querythread parameter is provided, it must be a threading.Thread
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
instance. It will be polled during the iteration and if it indicates that
the thread has finished, the function will raise StopIteration"""
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
repo.ui.debug("[diffrev] Traversing log for %s\n" % diffid)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
# traverse the changelog backwards
for rev in repo.changelog.revs(start=len(repo.changelog), stop=0):
if rev % 100 == 0 and querythread and querythread.is_alive() is False:
raise StopIteration("Parallel query completed")
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
changectx = repo[rev]
desc = changectx.description()
match = DIFFERENTIAL_REGEX.search(desc)
if match and match.group("id") == diffid:
return changectx.rev()
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
return None
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
def forksearch(repo, diffid):
"""Perform a log traversal and GraphQL call in parallel
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
Returns a (revisions, graphql_response) tuple, where one of the items will be
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
None, depending on which process terminated first"""
repo.ui.debug("[diffrev] Starting graphql call\n")
result = [None, None]
def makegraphqlcall():
try:
result[0] = getdiff(repo, diffid)
except Exception as exc:
result[1] = exc
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
querythread = threading.Thread(target=makegraphqlcall, name="graphqlquery")
querythread.daemon = True
querythread.start()
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
try:
repo.ui.debug("[diffrev] Starting log walk\n")
rev = finddiff(repo, diffid, querythread)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
repo.ui.debug("[diffrev] Parallel log walk completed with %s\n" % rev)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
if rev is None:
# walked the entire repo and couldn't find the diff
raise error.Abort("Could not find diff D%s in changelog" % diffid)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
return ([rev], None)
except StopIteration:
# search terminated because arc returned
# if returncode == 0, return arc's output
repo.ui.debug("[diffrev] graphql call returned %s\n" % result[0])
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
if result[1] is not None:
raise result[1]
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
return (None, result[0])
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
Don't crash in phrevset if Conduit replies before linear search completes Summary: When converting a Diff number to a revset, phrevset would do a linear scan of the repo history for the most recent appearance of that Diff number (slow if it's an older commit or not present in this repo) and in parallel, query Phabricator Conduit to try and shortcut the process. Unfortunately, if Conduit was quicker than the linear scan, we would crash because we can't handle a Conduit response for hg commits made when a Diff lands, or for any repo that doesn't have a callsign in hgrc. Fix the crashes; don't bother calling Conduit if we can't handle any reasonable answer, and teach the hg branch to handle all reasonable answers. Test Plan: Check that the new extension does linear search unconditionally when it lacks a callsign: ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 phrevset.callsign is not set - doing a linear search changeset: 3c0e6756bed4d7330391719bcde52e7490499e53 D2750128 user: Yuhan Guo <yhguo@fb.com> date: Thu, 07 Jan 2016 00:19:23 -0800 ``` Check that it doesn't do a linear search in a repo with a callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ echo -e '[phrevset]\ncallsign=E' >> .hg/hgrc : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 changeset: 4b24ee6737b7e36523eb24c6406d689cc54aadf9 D2704940 user: xifanyan@2c7ba8d8-a2f7-0310-a573-de162e16dcc7 date: Mon, 30 Nov 2015 23:38:18 -0800 ``` Check that it aborts cleanly if you give it a Diff from a different repo in a repo with a known callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 abort: Diff callsign 'FBS' is different from repo callsign 'E' ``` Check that linear scan eventually aborts cleanly if you give it a Diff from a different repo (note: this step is slow - over a minute on my devvm): ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 phrevset.callsign is not set - doing a linear search abort: Could not find diff D2704940 in changelog ``` Reviewers: #sourcecontrol, rmcelroy, ttung, lcharignon Reviewed By: lcharignon Subscribers: lcharignon, kanishkparihar Differential Revision: https://phabricator.fb.com/D2844832 Tasks: 9723813, 9714886 Signature: t1:2844832:1453321767:f445447d8187b4be22db3065ba316e6aa461f757
2016-01-21 19:11:13 +03:00
def parsedesc(repo, resp, ignoreparsefailure):
desc = resp["description"]
if desc is None:
if ignoreparsefailure:
return None
else:
raise error.Abort("No Conduit description")
match = DESCRIPTION_REGEX.match(desc)
if not match:
Don't crash in phrevset if Conduit replies before linear search completes Summary: When converting a Diff number to a revset, phrevset would do a linear scan of the repo history for the most recent appearance of that Diff number (slow if it's an older commit or not present in this repo) and in parallel, query Phabricator Conduit to try and shortcut the process. Unfortunately, if Conduit was quicker than the linear scan, we would crash because we can't handle a Conduit response for hg commits made when a Diff lands, or for any repo that doesn't have a callsign in hgrc. Fix the crashes; don't bother calling Conduit if we can't handle any reasonable answer, and teach the hg branch to handle all reasonable answers. Test Plan: Check that the new extension does linear search unconditionally when it lacks a callsign: ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 phrevset.callsign is not set - doing a linear search changeset: 3c0e6756bed4d7330391719bcde52e7490499e53 D2750128 user: Yuhan Guo <yhguo@fb.com> date: Thu, 07 Jan 2016 00:19:23 -0800 ``` Check that it doesn't do a linear search in a repo with a callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ echo -e '[phrevset]\ncallsign=E' >> .hg/hgrc : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 changeset: 4b24ee6737b7e36523eb24c6406d689cc54aadf9 D2704940 user: xifanyan@2c7ba8d8-a2f7-0310-a573-de162e16dcc7 date: Mon, 30 Nov 2015 23:38:18 -0800 ``` Check that it aborts cleanly if you give it a Diff from a different repo in a repo with a known callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 abort: Diff callsign 'FBS' is different from repo callsign 'E' ``` Check that linear scan eventually aborts cleanly if you give it a Diff from a different repo (note: this step is slow - over a minute on my devvm): ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 phrevset.callsign is not set - doing a linear search abort: Could not find diff D2704940 in changelog ``` Reviewers: #sourcecontrol, rmcelroy, ttung, lcharignon Reviewed By: lcharignon Subscribers: lcharignon, kanishkparihar Differential Revision: https://phabricator.fb.com/D2844832 Tasks: 9723813, 9714886 Signature: t1:2844832:1453321767:f445447d8187b4be22db3065ba316e6aa461f757
2016-01-21 19:11:13 +03:00
if ignoreparsefailure:
return None
else:
raise error.Abort("Cannot parse Conduit description '%s'" % desc)
callsign = match.group("callsign")
repo_callsign = repo.ui.config("phrevset", "callsign")
if callsign != repo_callsign:
raise error.Abort(
"Diff callsign '%s' is different from repo"
" callsign '%s'" % (callsign, repo_callsign)
)
return match.group("id")
@util.lrucachefunc
def revsetdiff(repo, diffid):
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
"""Return a set of revisions corresponding to a given Differential ID """
repo_callsign = repo.ui.config("phrevset", "callsign")
Don't crash in phrevset if Conduit replies before linear search completes Summary: When converting a Diff number to a revset, phrevset would do a linear scan of the repo history for the most recent appearance of that Diff number (slow if it's an older commit or not present in this repo) and in parallel, query Phabricator Conduit to try and shortcut the process. Unfortunately, if Conduit was quicker than the linear scan, we would crash because we can't handle a Conduit response for hg commits made when a Diff lands, or for any repo that doesn't have a callsign in hgrc. Fix the crashes; don't bother calling Conduit if we can't handle any reasonable answer, and teach the hg branch to handle all reasonable answers. Test Plan: Check that the new extension does linear search unconditionally when it lacks a callsign: ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 phrevset.callsign is not set - doing a linear search changeset: 3c0e6756bed4d7330391719bcde52e7490499e53 D2750128 user: Yuhan Guo <yhguo@fb.com> date: Thu, 07 Jan 2016 00:19:23 -0800 ``` Check that it doesn't do a linear search in a repo with a callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ echo -e '[phrevset]\ncallsign=E' >> .hg/hgrc : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 changeset: 4b24ee6737b7e36523eb24c6406d689cc54aadf9 D2704940 user: xifanyan@2c7ba8d8-a2f7-0310-a573-de162e16dcc7 date: Mon, 30 Nov 2015 23:38:18 -0800 ``` Check that it aborts cleanly if you give it a Diff from a different repo in a repo with a known callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 abort: Diff callsign 'FBS' is different from repo callsign 'E' ``` Check that linear scan eventually aborts cleanly if you give it a Diff from a different repo (note: this step is slow - over a minute on my devvm): ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 phrevset.callsign is not set - doing a linear search abort: Could not find diff D2704940 in changelog ``` Reviewers: #sourcecontrol, rmcelroy, ttung, lcharignon Reviewed By: lcharignon Subscribers: lcharignon, kanishkparihar Differential Revision: https://phabricator.fb.com/D2844832 Tasks: 9723813, 9714886 Signature: t1:2844832:1453321767:f445447d8187b4be22db3065ba316e6aa461f757
2016-01-21 19:11:13 +03:00
if repo_callsign is None:
msg = _("phrevset.callsign is not set - doing a linear search\n")
hint = _("This will be slow if the diff was not committed recently\n")
Don't crash in phrevset if Conduit replies before linear search completes Summary: When converting a Diff number to a revset, phrevset would do a linear scan of the repo history for the most recent appearance of that Diff number (slow if it's an older commit or not present in this repo) and in parallel, query Phabricator Conduit to try and shortcut the process. Unfortunately, if Conduit was quicker than the linear scan, we would crash because we can't handle a Conduit response for hg commits made when a Diff lands, or for any repo that doesn't have a callsign in hgrc. Fix the crashes; don't bother calling Conduit if we can't handle any reasonable answer, and teach the hg branch to handle all reasonable answers. Test Plan: Check that the new extension does linear search unconditionally when it lacks a callsign: ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 phrevset.callsign is not set - doing a linear search changeset: 3c0e6756bed4d7330391719bcde52e7490499e53 D2750128 user: Yuhan Guo <yhguo@fb.com> date: Thu, 07 Jan 2016 00:19:23 -0800 ``` Check that it doesn't do a linear search in a repo with a callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ echo -e '[phrevset]\ncallsign=E' >> .hg/hgrc : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 changeset: 4b24ee6737b7e36523eb24c6406d689cc54aadf9 D2704940 user: xifanyan@2c7ba8d8-a2f7-0310-a573-de162e16dcc7 date: Mon, 30 Nov 2015 23:38:18 -0800 ``` Check that it aborts cleanly if you give it a Diff from a different repo in a repo with a known callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 abort: Diff callsign 'FBS' is different from repo callsign 'E' ``` Check that linear scan eventually aborts cleanly if you give it a Diff from a different repo (note: this step is slow - over a minute on my devvm): ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 phrevset.callsign is not set - doing a linear search abort: Could not find diff D2704940 in changelog ``` Reviewers: #sourcecontrol, rmcelroy, ttung, lcharignon Reviewed By: lcharignon Subscribers: lcharignon, kanishkparihar Differential Revision: https://phabricator.fb.com/D2844832 Tasks: 9723813, 9714886 Signature: t1:2844832:1453321767:f445447d8187b4be22db3065ba316e6aa461f757
2016-01-21 19:11:13 +03:00
repo.ui.warn(msg)
repo.ui.warn(hint)
rev = finddiff(repo, diffid)
if rev is None:
raise error.Abort("Could not find diff D%s in changelog" % diffid)
Don't crash in phrevset if Conduit replies before linear search completes Summary: When converting a Diff number to a revset, phrevset would do a linear scan of the repo history for the most recent appearance of that Diff number (slow if it's an older commit or not present in this repo) and in parallel, query Phabricator Conduit to try and shortcut the process. Unfortunately, if Conduit was quicker than the linear scan, we would crash because we can't handle a Conduit response for hg commits made when a Diff lands, or for any repo that doesn't have a callsign in hgrc. Fix the crashes; don't bother calling Conduit if we can't handle any reasonable answer, and teach the hg branch to handle all reasonable answers. Test Plan: Check that the new extension does linear search unconditionally when it lacks a callsign: ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 phrevset.callsign is not set - doing a linear search changeset: 3c0e6756bed4d7330391719bcde52e7490499e53 D2750128 user: Yuhan Guo <yhguo@fb.com> date: Thu, 07 Jan 2016 00:19:23 -0800 ``` Check that it doesn't do a linear search in a repo with a callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ echo -e '[phrevset]\ncallsign=E' >> .hg/hgrc : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 changeset: 4b24ee6737b7e36523eb24c6406d689cc54aadf9 D2704940 user: xifanyan@2c7ba8d8-a2f7-0310-a573-de162e16dcc7 date: Mon, 30 Nov 2015 23:38:18 -0800 ``` Check that it aborts cleanly if you give it a Diff from a different repo in a repo with a known callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 abort: Diff callsign 'FBS' is different from repo callsign 'E' ``` Check that linear scan eventually aborts cleanly if you give it a Diff from a different repo (note: this step is slow - over a minute on my devvm): ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 phrevset.callsign is not set - doing a linear search abort: Could not find diff D2704940 in changelog ``` Reviewers: #sourcecontrol, rmcelroy, ttung, lcharignon Reviewed By: lcharignon Subscribers: lcharignon, kanishkparihar Differential Revision: https://phabricator.fb.com/D2844832 Tasks: 9723813, 9714886 Signature: t1:2844832:1453321767:f445447d8187b4be22db3065ba316e6aa461f757
2016-01-21 19:11:13 +03:00
else:
return [rev]
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
Don't crash in phrevset if Conduit replies before linear search completes Summary: When converting a Diff number to a revset, phrevset would do a linear scan of the repo history for the most recent appearance of that Diff number (slow if it's an older commit or not present in this repo) and in parallel, query Phabricator Conduit to try and shortcut the process. Unfortunately, if Conduit was quicker than the linear scan, we would crash because we can't handle a Conduit response for hg commits made when a Diff lands, or for any repo that doesn't have a callsign in hgrc. Fix the crashes; don't bother calling Conduit if we can't handle any reasonable answer, and teach the hg branch to handle all reasonable answers. Test Plan: Check that the new extension does linear search unconditionally when it lacks a callsign: ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 phrevset.callsign is not set - doing a linear search changeset: 3c0e6756bed4d7330391719bcde52e7490499e53 D2750128 user: Yuhan Guo <yhguo@fb.com> date: Thu, 07 Jan 2016 00:19:23 -0800 ``` Check that it doesn't do a linear search in a repo with a callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ echo -e '[phrevset]\ncallsign=E' >> .hg/hgrc : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 changeset: 4b24ee6737b7e36523eb24c6406d689cc54aadf9 D2704940 user: xifanyan@2c7ba8d8-a2f7-0310-a573-de162e16dcc7 date: Mon, 30 Nov 2015 23:38:18 -0800 ``` Check that it aborts cleanly if you give it a Diff from a different repo in a repo with a known callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 abort: Diff callsign 'FBS' is different from repo callsign 'E' ``` Check that linear scan eventually aborts cleanly if you give it a Diff from a different repo (note: this step is slow - over a minute on my devvm): ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 phrevset.callsign is not set - doing a linear search abort: Could not find diff D2704940 in changelog ``` Reviewers: #sourcecontrol, rmcelroy, ttung, lcharignon Reviewed By: lcharignon Subscribers: lcharignon, kanishkparihar Differential Revision: https://phabricator.fb.com/D2844832 Tasks: 9723813, 9714886 Signature: t1:2844832:1453321767:f445447d8187b4be22db3065ba316e6aa461f757
2016-01-21 19:11:13 +03:00
revs, resp = forksearch(repo, diffid)
if revs is not None:
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
# The log walk found the diff, nothing more to do
Don't crash in phrevset if Conduit replies before linear search completes Summary: When converting a Diff number to a revset, phrevset would do a linear scan of the repo history for the most recent appearance of that Diff number (slow if it's an older commit or not present in this repo) and in parallel, query Phabricator Conduit to try and shortcut the process. Unfortunately, if Conduit was quicker than the linear scan, we would crash because we can't handle a Conduit response for hg commits made when a Diff lands, or for any repo that doesn't have a callsign in hgrc. Fix the crashes; don't bother calling Conduit if we can't handle any reasonable answer, and teach the hg branch to handle all reasonable answers. Test Plan: Check that the new extension does linear search unconditionally when it lacks a callsign: ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 phrevset.callsign is not set - doing a linear search changeset: 3c0e6756bed4d7330391719bcde52e7490499e53 D2750128 user: Yuhan Guo <yhguo@fb.com> date: Thu, 07 Jan 2016 00:19:23 -0800 ``` Check that it doesn't do a linear search in a repo with a callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ echo -e '[phrevset]\ncallsign=E' >> .hg/hgrc : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 changeset: 4b24ee6737b7e36523eb24c6406d689cc54aadf9 D2704940 user: xifanyan@2c7ba8d8-a2f7-0310-a573-de162e16dcc7 date: Mon, 30 Nov 2015 23:38:18 -0800 ``` Check that it aborts cleanly if you give it a Diff from a different repo in a repo with a known callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 abort: Diff callsign 'FBS' is different from repo callsign 'E' ``` Check that linear scan eventually aborts cleanly if you give it a Diff from a different repo (note: this step is slow - over a minute on my devvm): ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 phrevset.callsign is not set - doing a linear search abort: Could not find diff D2704940 in changelog ``` Reviewers: #sourcecontrol, rmcelroy, ttung, lcharignon Reviewed By: lcharignon Subscribers: lcharignon, kanishkparihar Differential Revision: https://phabricator.fb.com/D2844832 Tasks: 9723813, 9714886 Signature: t1:2844832:1453321767:f445447d8187b4be22db3065ba316e6aa461f757
2016-01-21 19:11:13 +03:00
return revs
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
if resp is None:
# The graphql query finished but didn't return anything
return []
vcs = resp["source_control_system"]
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
repo.ui.debug("[diffrev] VCS is %s\n" % vcs)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
if vcs == "svn" and svnutil:
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
# commit has landed in svn, parse the description to get the SVN
# revision and delegate to hgsubversion for the rest
Don't crash in phrevset if Conduit replies before linear search completes Summary: When converting a Diff number to a revset, phrevset would do a linear scan of the repo history for the most recent appearance of that Diff number (slow if it's an older commit or not present in this repo) and in parallel, query Phabricator Conduit to try and shortcut the process. Unfortunately, if Conduit was quicker than the linear scan, we would crash because we can't handle a Conduit response for hg commits made when a Diff lands, or for any repo that doesn't have a callsign in hgrc. Fix the crashes; don't bother calling Conduit if we can't handle any reasonable answer, and teach the hg branch to handle all reasonable answers. Test Plan: Check that the new extension does linear search unconditionally when it lacks a callsign: ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 phrevset.callsign is not set - doing a linear search changeset: 3c0e6756bed4d7330391719bcde52e7490499e53 D2750128 user: Yuhan Guo <yhguo@fb.com> date: Thu, 07 Jan 2016 00:19:23 -0800 ``` Check that it doesn't do a linear search in a repo with a callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ echo -e '[phrevset]\ncallsign=E' >> .hg/hgrc : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 changeset: 4b24ee6737b7e36523eb24c6406d689cc54aadf9 D2704940 user: xifanyan@2c7ba8d8-a2f7-0310-a573-de162e16dcc7 date: Mon, 30 Nov 2015 23:38:18 -0800 ``` Check that it aborts cleanly if you give it a Diff from a different repo in a repo with a known callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 abort: Diff callsign 'FBS' is different from repo callsign 'E' ``` Check that linear scan eventually aborts cleanly if you give it a Diff from a different repo (note: this step is slow - over a minute on my devvm): ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 phrevset.callsign is not set - doing a linear search abort: Could not find diff D2704940 in changelog ``` Reviewers: #sourcecontrol, rmcelroy, ttung, lcharignon Reviewed By: lcharignon Subscribers: lcharignon, kanishkparihar Differential Revision: https://phabricator.fb.com/D2844832 Tasks: 9723813, 9714886 Signature: t1:2844832:1453321767:f445447d8187b4be22db3065ba316e6aa461f757
2016-01-21 19:11:13 +03:00
svnrev = parsedesc(repo, resp, ignoreparsefailure=False)
repo.ui.debug("[diffrev] SVN rev is r%s\n" % svnrev)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
return [repo[n].rev() for n in svnutil.lookuprev(repo, svnrev)]
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
elif vcs == "git":
Don't crash in phrevset if Conduit replies before linear search completes Summary: When converting a Diff number to a revset, phrevset would do a linear scan of the repo history for the most recent appearance of that Diff number (slow if it's an older commit or not present in this repo) and in parallel, query Phabricator Conduit to try and shortcut the process. Unfortunately, if Conduit was quicker than the linear scan, we would crash because we can't handle a Conduit response for hg commits made when a Diff lands, or for any repo that doesn't have a callsign in hgrc. Fix the crashes; don't bother calling Conduit if we can't handle any reasonable answer, and teach the hg branch to handle all reasonable answers. Test Plan: Check that the new extension does linear search unconditionally when it lacks a callsign: ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 phrevset.callsign is not set - doing a linear search changeset: 3c0e6756bed4d7330391719bcde52e7490499e53 D2750128 user: Yuhan Guo <yhguo@fb.com> date: Thu, 07 Jan 2016 00:19:23 -0800 ``` Check that it doesn't do a linear search in a repo with a callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ echo -e '[phrevset]\ncallsign=E' >> .hg/hgrc : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 changeset: 4b24ee6737b7e36523eb24c6406d689cc54aadf9 D2704940 user: xifanyan@2c7ba8d8-a2f7-0310-a573-de162e16dcc7 date: Mon, 30 Nov 2015 23:38:18 -0800 ``` Check that it aborts cleanly if you give it a Diff from a different repo in a repo with a known callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 abort: Diff callsign 'FBS' is different from repo callsign 'E' ``` Check that linear scan eventually aborts cleanly if you give it a Diff from a different repo (note: this step is slow - over a minute on my devvm): ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 phrevset.callsign is not set - doing a linear search abort: Could not find diff D2704940 in changelog ``` Reviewers: #sourcecontrol, rmcelroy, ttung, lcharignon Reviewed By: lcharignon Subscribers: lcharignon, kanishkparihar Differential Revision: https://phabricator.fb.com/D2844832 Tasks: 9723813, 9714886 Signature: t1:2844832:1453321767:f445447d8187b4be22db3065ba316e6aa461f757
2016-01-21 19:11:13 +03:00
gitrev = parsedesc(repo, resp, ignoreparsefailure=False)
repo.ui.debug("[diffrev] GIT rev is %s\n" % gitrev)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
peerpath = repo.ui.expandpath("default")
remoterepo = hg.peer(repo, {}, peerpath)
remoterev = remoterepo.lookup("_gitlookup_git_%s" % gitrev)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
repo.ui.debug("[diffrev] HG rev is %s\n" % remoterev.encode("hex"))
if not remoterev:
repo.ui.debug("[diffrev] Falling back to linear search\n")
linear_search_result = finddiff(repo, diffid)
if linear_search_result is None:
# walked the entire repo and couldn't find the diff
raise error.Abort("Could not find diff D%s in changelog" % diffid)
return [linear_search_result]
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
return [repo[remoterev].rev()]
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
elif vcs == "hg":
Don't crash in phrevset if Conduit replies before linear search completes Summary: When converting a Diff number to a revset, phrevset would do a linear scan of the repo history for the most recent appearance of that Diff number (slow if it's an older commit or not present in this repo) and in parallel, query Phabricator Conduit to try and shortcut the process. Unfortunately, if Conduit was quicker than the linear scan, we would crash because we can't handle a Conduit response for hg commits made when a Diff lands, or for any repo that doesn't have a callsign in hgrc. Fix the crashes; don't bother calling Conduit if we can't handle any reasonable answer, and teach the hg branch to handle all reasonable answers. Test Plan: Check that the new extension does linear search unconditionally when it lacks a callsign: ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 phrevset.callsign is not set - doing a linear search changeset: 3c0e6756bed4d7330391719bcde52e7490499e53 D2750128 user: Yuhan Guo <yhguo@fb.com> date: Thu, 07 Jan 2016 00:19:23 -0800 ``` Check that it doesn't do a linear search in a repo with a callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ echo -e '[phrevset]\ncallsign=E' >> .hg/hgrc : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 changeset: 4b24ee6737b7e36523eb24c6406d689cc54aadf9 D2704940 user: xifanyan@2c7ba8d8-a2f7-0310-a573-de162e16dcc7 date: Mon, 30 Nov 2015 23:38:18 -0800 ``` Check that it aborts cleanly if you give it a Diff from a different repo in a repo with a known callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 abort: Diff callsign 'FBS' is different from repo callsign 'E' ``` Check that linear scan eventually aborts cleanly if you give it a Diff from a different repo (note: this step is slow - over a minute on my devvm): ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 phrevset.callsign is not set - doing a linear search abort: Could not find diff D2704940 in changelog ``` Reviewers: #sourcecontrol, rmcelroy, ttung, lcharignon Reviewed By: lcharignon Subscribers: lcharignon, kanishkparihar Differential Revision: https://phabricator.fb.com/D2844832 Tasks: 9723813, 9714886 Signature: t1:2844832:1453321767:f445447d8187b4be22db3065ba316e6aa461f757
2016-01-21 19:11:13 +03:00
rev = parsedesc(repo, resp, ignoreparsefailure=True)
if rev:
# The response from phabricator contains a changeset ID.
# Convert it back to a rev number.
try:
return [repo[rev.encode("utf-8")].rev()]
except error.RepoLookupError:
# TODO: 's/svnrev/globalrev' after turning off Subversion
# servers. We will know about this when we remove the `svnrev`
# revset.
#
# Unfortunately the rev can also be a svnrev/globalrev :(.
if rev.isdigit():
try:
return [r for r in repo.revs("svnrev(%s)" % rev)]
except error.RepoLookupError:
pass
raise error.Abort(
"Landed commit for diff D%s not available "
'in current repository: run "hg pull" '
"to retrieve it" % diffid
)
Don't crash in phrevset if Conduit replies before linear search completes Summary: When converting a Diff number to a revset, phrevset would do a linear scan of the repo history for the most recent appearance of that Diff number (slow if it's an older commit or not present in this repo) and in parallel, query Phabricator Conduit to try and shortcut the process. Unfortunately, if Conduit was quicker than the linear scan, we would crash because we can't handle a Conduit response for hg commits made when a Diff lands, or for any repo that doesn't have a callsign in hgrc. Fix the crashes; don't bother calling Conduit if we can't handle any reasonable answer, and teach the hg branch to handle all reasonable answers. Test Plan: Check that the new extension does linear search unconditionally when it lacks a callsign: ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 phrevset.callsign is not set - doing a linear search changeset: 3c0e6756bed4d7330391719bcde52e7490499e53 D2750128 user: Yuhan Guo <yhguo@fb.com> date: Thu, 07 Jan 2016 00:19:23 -0800 ``` Check that it doesn't do a linear search in a repo with a callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ echo -e '[phrevset]\ncallsign=E' >> .hg/hgrc : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 changeset: 4b24ee6737b7e36523eb24c6406d689cc54aadf9 D2704940 user: xifanyan@2c7ba8d8-a2f7-0310-a573-de162e16dcc7 date: Mon, 30 Nov 2015 23:38:18 -0800 ``` Check that it aborts cleanly if you give it a Diff from a different repo in a repo with a known callsign: ``` : /data/users/simonfar/www-hg (hg) [webacademy-graphql] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2750128 abort: Diff callsign 'FBS' is different from repo callsign 'E' ``` Check that linear scan eventually aborts cleanly if you give it a Diff from a different repo (note: this step is slow - over a minute on my devvm): ``` : /data/users/simonfar/fbsource (hg) [90234606e65a2a04d042caba7cf5ee85a7a5466e] : simonfar@devvm631 $ hg --config extensions.phrevset=/data/users/simonfar/fb-hgext/phrevset.py log -r D2704940 phrevset.callsign is not set - doing a linear search abort: Could not find diff D2704940 in changelog ``` Reviewers: #sourcecontrol, rmcelroy, ttung, lcharignon Reviewed By: lcharignon Subscribers: lcharignon, kanishkparihar Differential Revision: https://phabricator.fb.com/D2844832 Tasks: 9723813, 9714886 Signature: t1:2844832:1453321767:f445447d8187b4be22db3065ba316e6aa461f757
2016-01-21 19:11:13 +03:00
# commit is still local, get its hash
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
props = resp["phabricator_version_properties"]["edges"]
commits = []
for prop in props:
if prop["node"]["property_name"] == "local:commits":
commits = json.loads(prop["node"]["property_value"])
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
# the JSON parser returns Unicode strings, convert to `str` in UTF-8
revs = [c["commit"].encode("utf-8") for c in commits.values()]
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
# verify all revisions exist in the current repo; if not, try to
# find their counterpart by parsing the log
results = set()
for rev in revs:
# TODO: This really should be searching in repo.unfiltered(),
# and then resolving successors if the commit was hidden.
try:
node = repo[rev.encode("utf-8")]
results.add(node.rev())
except error.RepoLookupError:
repo.ui.warn(_("Commit not found - doing a linear search\n"))
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
parsed_rev = finddiff(repo, diffid)
if not parsed_rev:
raise error.Abort(
"Could not find diff " "D%s in changelog" % diffid
)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
results.add(parsed_rev)
if not results:
raise error.Abort("Could not find local commit for D%s" % diffid)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
return set(results)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
else:
if not vcs:
msg = (
"D%s does not have an associated version control system\n"
"You can view the diff at http://phabricator.fb.com/D%s\n\n"
)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
repo.ui.warn(msg % (diffid, diffid))
return []
else:
raise error.Abort(
"Conduit returned unknown " 'sourceControlSystem "%s"' % vcs
)
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
def _lookupname(repo, name):
cl = repo.changelog
tonode = cl.node
if name.startswith("D") and name[1:].isdigit():
return [tonode(r) for r in revsetdiff(repo, name[1:])]
else:
return []
[hg] Add support for Differential revsets Summary: Add the ability to issue commands like hg log -r D12345 Supports already shipped commits (by parsing the SVN rev number and delegating to hgsubversion), as well as mercurial commits in various states Test Plan: Easier to show than tell: [delyank@dev1436 ~/www] arc feature test_diff_revset [delyank@dev1436 ~/www] echo "Don't commit me" > dontcommit.test [delyank@dev1436 ~/www] hg add dontcommit.test [delyank@dev1436 ~/www] hg commit -m "[test] Test commit" [delyank@dev1436 ~/www] arc diff [...] Created a new Differential revision: Revision URI: https://phabricator.fb.com/D1055569 [...] [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg changeset: 587735:82d4de66e17bb3b92fe15df4eda8b8420b7ed074 bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] echo "No, really, don't" >> dontcommit.test [delyank@dev1436 ~/www] hg amend # change local hash [delyank@dev1436 ~/www] hg log --debug -r D1055569 [diffrev] Getting diff from Conduit..done [diffrev] VCS is hg [diffrev] Traversing log for 1055569 changeset: 587735:48565d21a43f730aa3b9cebccbb47fa406df557b bookmark: test_diff_revset tag: tip phase: draft [...] description: [test] Playing with conduit, don't commit [...] Differential Revision: https://phabricator.fb.com/D1055569 [delyank@dev1436 ~/www] hg log --debug -r D1053132 # a diff that's already been shipped [diffrev] Getting diff from Conduit..done [diffrev] VCS is svn changeset: 586857:61a4036e89bafefaba4de2ebe1190db999a8915d [...] description: [hashtagbot] Add the #filetask hashtag to Task Creeper [...] Differential Revision: https://phabricator.fb.com/D1053132 Reviewers: sid0, davidsp Reviewed By: davidsp CC: jhunt, davidsp Differential Revision: https://phabricator.fb.com/D1055637 Task ID: 3159944
2013-11-16 02:55:42 +04:00
@namespacepredicate("phrevset", priority=70)
def _getnamespace(_repo):
return namespaces.namespace(
listnames=lambda repo: [], namemap=_lookupname, nodemap=lambda repo, node: []
)