Commit Graph

13 Commits

Author SHA1 Message Date
Laurent Charignon
a27b0abfb8 cleanup: make all the code compliant with the i18n rules for ui strings
Summary: This diff is part of a series to cleanup fb-hgext and make it pass check-code.

Test Plan: all tests pass

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2811887
2016-01-11 10:19:22 -08:00
Laurent Charignon
98f0478001 cleanup: remove semicolon
Summary: This diff is part of a series to cleanup fb-hgext and make it pass check-code.

Test Plan: all tests pass

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2812219
2016-01-07 18:30:24 -08:00
Laurent Charignon
a42808982c cleanup: fix the "line too long" warnings
Summary: This diff is part of a series to cleanup fb-hgext and make it pass check-code.

Test Plan: all tests pass

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2811926
2016-01-07 18:30:24 -08:00
Laurent Charignon
b36541de7d cleanup: replace all the calls to util.Abort to error.Abort
Summary: This diff is part of a series to cleanup fb-hgext and make it pass check-code.

Test Plan: all tests pass like before

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2811837
2016-01-07 18:30:24 -08:00
Christian Delahousse
d533bf0de0 fbconduit: de-phabricator-ize hg and git hashes
Summary:
Remove the need to ommit the rREPO prefix when copy pasting from phabricator and
looking up a commit.

Test Plan:
Ran the following in phabricator enabled HG repos

  11/13 12:15 cdelahousse@dev4253 ~/fbsource/fbcode
  $ hg log -r rFBS27aa00fb74d9a3b82756dad6ff26fe253f1e9a70 --config extensions.fbconduit=~/local/fb-hgext/fbconduit.py
  changeset:   992495:27aa00fb74d9
  user:        Peng Li <pengli@fb.com>
  date:        Tue Nov 03 10:29:01 2015 -0800
  summary:     Add a simple root dir arc library


  11/13 12:21 cdelahousse@dev4253 ~/fbjava
  $ hg log -r rFBA8f1335e6d588 --config extensions.fbconduit=~/local/fb-hgext/fbconduit.py
  changeset:   18654:8f1335e6d588
  user:        Ryan Menezes <ryandm@fb.com>
  date:        Thu Oct 22 09:59:27 2015 -0700
  summary:     move jenkins hook into fbjava/arcanist (fbjava changes)

Tried the same on a repo with a git mirror that exists in phabricator:


  11/16 11:40 cdelahousse@dev4253 ~/fbsource/fbcode
  $ hg log -r rFBCODE8272d25d65869ce059024ff38c7051388ad7b802 --config extensions.fbconduit=~/local/fb-hgext/fbconduit.py
  changeset:   1027287:f26a9c32ae08
  user:        Oleksandr Kuvshynov <oleksandr@fb.com>
  date:        Sun Nov 15 19:16:39 2015 -0800
  summary:     [mf] simple cleanup of feed story view


If a git hash is too small, abort:


  $ hg log -r rFBCODE8272d25d65869ce059024f --config extensions.fbconduit=~/local/fb-hgext/fbconduit.py
  abort: git hash must be 40 characters



The previous commands depends on a list of repos set in my hgrc. See (D2660070)

  [fbconduit]
  gitcallsigns=LK, CFPUMA, CFSV, CFGK, CFMF, CFGMON, CF, RSIGMA, FA,·
    WAWEBCLIENT, SKY, FBCODE, FBOBJC, WAWP, SV, OVRMOBILEMAIN, WAANDROID, IGSRV,
    CPE, MSS, ANDROIDSDK, BUCK, IT-CHEF, WABB, ITINFRA, SIGMA, IOSSDK

Reviewers: #sourcecontrol, durham, ericsumner

Reviewed By: durham, ericsumner

Subscribers: rmcelroy, ericsumner

Differential Revision: https://phabricator.fb.com/D2653497

Tasks: 8361368

Signature: t1:2653497:1447480768:295079a7793e182ddea3aeece9cfaead1bfc1a57
2015-11-17 15:22:08 -08:00
Christian Delahousse
67eae4b104 fbconduit: dephabricatorization - fixed issue with hash starting with a digit
Summary: The regular expression was matching hg hashes that started with a digit.

Test Plan:
Ran it in different repoes:

This should fail (fbcode)
  11/13 11:15 cdelahousse@dev4253 ~/fbsource/fbcode
  $ hg up rFBCODE8a781801149 --config extensions.fbconduit=~/local/fb-hgext/fbconduit.py
  abort: unknown revision 'rFBCODE8a781801149'!

These should succeed (WWW and opsfiles)

  11/13 11:16 cdelahousse@dev4253 ~/www
  $ hg log -r rE1502460 --config
  extensions.fbconduit=~/local/fb-hgext/fbconduit.py
  changeset:   808001:34d7f02c58d6
  user:        cdelahousse@2c7ba8d8-a2f7-0310-a573-de162e16dcc7
  date:        Thu Nov 20 04:45:21 2014 +0000
  summary:     CRMEmailHarvester Script runner for raw email processor

  11/13 11:29 cdelahousse@dev4253 ~/opsfiles
  $ hg log -r rO766855 --config
  extensions.fbconduit=~/local/fb-hgext/fbconduit.py
  changeset:   758197:db438a952785
  user:        twsvcscm@914ed892-1039-11dd-9db8-c56a9f3689f4
  date:        Sat Oct 31 01:13:33 2015 +0000
  summary:     [Storage] netgroup_gen AUTOCOMMIT

Reviewers: #sourcecontrol, rmcelroy

Subscribers: cdown

Differential Revision: https://phabricator.fb.com/D2653121

Tasks: 9071883
2015-11-13 11:31:46 -08:00
Christian Delahousse
72637f0213 fbconduit: de-phabricatorify svn revision numbers
Summary:
Removes the need strip the capital letters from an SVN revision when accessing a revision
rE1502460 -> r1502460

Test Plan:
Manually in opsfiles hg and dubdubdub

In opsfiles:

  hg show rO766855

In dub dub dub

  hg log -r rE1502460

Reviewers: durham, #sourcecontrol, ericsumner, rmcelroy

Subscribers: ericsumner, rmcelroy

Differential Revision: https://phabricator.fb.com/D2603749

Tasks: 8361368
2015-11-09 15:54:07 -08:00
Tony Tung
6fdff081b8 fix breakages due to fbconduit api changes regarding missing revs
Summary:
FBConduit used to throw a conduit error when a rev didn't map.
Now, it just returns an empty string for the mapping.  This updates the
fbconduit extension so that it matches the server behavior.

Test Plan: passed unit tests.

Reviewers: mitrandir, ericsumner, durham

Reviewed By: ericsumner

Subscribers: mitrandir

Differential Revision: https://phabricator.fb.com/D2331464

Tasks: 7970302

Signature: t1:2331464:1439500203:cbf79e9b9c54aebdf33bbad82c1982b5a69e8bc9
2015-08-10 21:22:21 -07:00
Tony Tung
db22778620 support for multiple backing repos.
Summary:
# added a backingrepo list configuration variable that enumerates the backing repos.
# wrote a bunch of unit tests to cover this functionality.

Test Plan: passed unit tests.

Reviewers: rmcelroy, durham, ericsumner

Subscribers: mitrandir

Differential Revision: https://phabricator.fb.com/D2247419
2015-07-15 14:48:57 -07:00
Tony Tung
6d89af0509 fix small bugs in fbconduit
Summary:
# mapping['repo'] doesn't exist.  looks like it was copypasta from `mirrornode()`.
# the error message is not particularly helpful (it's basically the server return message without any context).  changed that.
# repo[hash] runs into a mercurial bug where passing in a hash string triggers some unicode error messages (https://phabricator.fb.com/P19919583).  work around this by querying with the binary string representation.

Test Plan: passed fbconduit unit test.

Reviewers: lcharignon, rmcelroy, durham, ericsumner

Reviewed By: ericsumner

Subscribers: mitrandir

Differential Revision: https://phabricator.fb.com/D2246978

Signature: t1:2246978:1436993587:31857064ce810c604ce1c071bfed484b96150b37
2015-07-15 13:40:08 -07:00
Tony Tung
322c935d1b support http mode operation for fbconduit
Summary:
Added a config option fbconduit:protocol to override the
protocol.  It can be set to http or https.

Test Plan: used in later diff

Reviewers: lcharignon, rmcelroy, durham, ericsumner

Reviewed By: ericsumner

Subscribers: mitrandir

Differential Revision: https://phabricator.fb.com/D2244919

Signature: t1:2244919:1436982823:6c5cb7085607285d2a68822ee2401a11af3201f5
2015-07-14 23:04:03 -07:00
Eric Sumner
7e1147b62d [fbconduit] support gitnode template and revset
Summary:
This copies a bunch of logic from ##gitrevset.py## which should allow the
##fbconduit## extension to be a complete replacement for ##gitrevset##.
Overall, execution times are comparable for the revset and will be much
better for the template (assuming >20% cache hit rate)

Test Plan:
  hg log -r 'gitnode("32cb236d579acb48668f8575205c0611b859e883")' -T '{node}\n'
  hg log -r 'g32cb236d579acb48668f8575205c0611b859e883' -T '{node}\n'
  hg log -r 'master~50::master' -T '{gitnode}\n'

Reviewers: #sourcecontrol, sid0

Reviewed By: #sourcecontrol, sid0

Subscribers: sid0

Differential Revision: https://phabricator.fb.com/D2074214
2015-05-15 13:36:16 -07:00
Eric Sumner
cc30c1fd65 fbconduit extension
Summary: Adds a template method to fetch hash translations from scmquery

Test Plan:
  [ericsumner@dev2048 ~/fbcode] time hg log -T '{node} {mirrornode("git")}\n' --config extensions.conduit=~/fb-hgext/fbconduit.py -r 'master~5::master' --config fbconduit.reponame=fbcode
  744def84d4821ae847ca9e2c31147ec495b0ff2a e498cef35914c5a7a8de648888e47b0d6c452044
  86d589bbed310cac765d1d2822f350c66f55ee30 a49473c0f0a0eaa532f0f25f8e632015dc57de87
  74e5eddf18a9e911b561d2f2f79c433971e36234 608e41cd9c4e8a0ba8dcd3f53162fed656354db0
  95a4cce9686558864af97631142a23eee1ffd1b0 228cbfc779da14306ae43002317bf59be9b3844d
  9ec5dfd21c5360bcff66ddd3db4747742da9bd56 115df93aa18a5003323f5419bbd135a9a08d96b9
  721fd7f98313aec4513bf86817bf98e01238ebdc 170cde24839d9213efa11f4f965402fd5e13cc9b

  real  0m0.407s
  user  0m0.229s
  sys 0m0.080s
  [ericsumner@dev2048 ~/fbcode] time hg log -T '{node} {mirrornode("git")}\n' --config extensions.conduit=~/fb-hgext/fbconduit.py -r 'ancestor(.,master)::master' --config fbconduit.reponame=fbcode | wc -l
  157

  real  0m2.718s
  user  0m0.504s
  sys 0m0.066s

Reviewers: #sourcecontrol, durham

Reviewed By: #sourcecontrol, durham

Subscribers: sid0, durham, lcharignon

Differential Revision: https://phabricator.fb.com/D2070465
2015-05-13 16:24:51 -07:00