Homec4science

Conditionally use `hg files` vs. `hg locate` depending on version of Mercurial

Authored by Christopher Speck <die.drachen@gmail.com> on Oct 13 2015, 02:50.

Description

Conditionally use hg files vs. hg locate depending on version of Mercurial

Summary:
In Mercurial 3.2 the locate command was deprecated in favor of files command. This change updates the DiffusionLowLevelMercurialPathsQuery command to conditionally use locate or files based on the version of Mercurial used.

Closes T7375

Test Plan:
My test/develop Phabricator instance is setup to run Mercurial 3.5.1.

The test procedure to verify valid file listings are being returned:

  1. I navigated to http://192.168.0.133/conduit/method/diffusion.querypaths/
  2. I populated the following fields:
    • path: "/"
    • commit: "d721d5b57fc9ef72e47ff9d4e0c583d74a46590c"
    • callsign: "HGTEST"
  3. I submitted request and verified that result contained all files in the repository:
{
  "0": "README",
  "1": "alpha/beta/trifle",
  "2": "test/Chupacabra.cow",
  "3": "test/socket.ks"
}

I repeated the above steps after setting up Mercurial 2.6.2, which I installed in the following manner:

  1. I downloaded Mercurial 2.6.2 source and run make local which will only compile it to work from its own directory (/opt/mercurial-2.6.2)
  2. I linked /usr/local/bin/hg -> /opt/mercurial-2.6.2/hg (there's also a /usr/bin/hg which is a link to /usr/local/bin/hg)
  3. I navigated to my home directory and verify that hg --version returns 2.6.2.
  4. I restarted phabricator services (probably unnecessary).

With the Multimeter application active

  1. I verified that /usr/local/bin/hg referred to version 2.6
  2. I ran the same conduit call from the conduit application
  3. I verified that http://192.168.0.133/multimeter/?type=2&group=label incremented values for bin.hg locate.
  4. I swapped out mercurial versions for 3.5.1
  5. I ran the same conduit call from the conduit application
  6. I verified that http://192.168.0.133/multimeter/?type=2&group=label incremented values for bin.hg files

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T7375

Differential Revision: https://secure.phabricator.com/D14253

Details

Committed
epriestley <git@epriestley.com>Oct 13 2015, 02:50
Pushed
aubortJan 31 2017, 17:16
Parents
rPHcd8be8106be8: Improve ruleset for generating project hashtags
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH812c41a18abd: Conditionally use `hg files` vs. `hg locate` depending on version of Mercurial (authored by Christopher Speck <die.drachen@gmail.com>).Oct 13 2015, 02:50