Page MenuHomePhabricator

Fix replicating open patches
Needs ReviewPublic

Authored by paladox on Dec 17 2015, 8:55 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Required Signatures
L28 Phacility Individual Contributor License Agreement
Summary

Support replicating open patches from refs/changes/* also support viewing
refs/meta which would be useful when migrating from gerrit.

This update is for when phabricator is replicating.

This supports replicating open patches from gerrit.

This helps in the migration from gerrit to phabricator

Test Plan

This helps the migration from gerrit to phabricator by allowing us to view the files from gerrit in phabricator including open patches which is what this patch is fixing.

Diff Detail

Repository
rP Phabricator
Branch
arcpatch-D14813_3
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 9630
Build 11527: arc lint + arc unit

Event Timeline

paladox created this object with visibility "Public (No Login Required)".Dec 17 2015, 8:55 PM
paladox created this object with edit policy "All Users".

@epriestley I am not sure what I did fixes the problem or if I edited the wrong file.

Would the correct file be PhabricatorRepositoryPullEngine.php

epriestley requested changes to this revision.Dec 17 2015, 9:09 PM
epriestley edited edge metadata.

This doesn't do what you want, and presumably hasn't been tested at all since it doesn't work and breaks normal branches.

I'm not willing to upstream changes which hardcode Gerrit paths into Phabricator.

See Contributing Code.

This revision now requires changes to proceed.Dec 17 2015, 9:09 PM

@epriestley is there any way to support system.gitconfig or phabricator.gitconfig file that would allow us to specify which refs to pull allowing us to choose our refs without needing to hard code them.

Also which file would need the change to support what I am trying to achive since there are multiple files with refs/heads but the one file that I think is related is PhabricatorRepositoryPullEngine.php

paladox edited edge metadata.

Some minor changes.

paladox added inline comments.Dec 18 2015, 5:08 PM
src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
314

@epriestley

If I was to do something like

$future = $repository->getRemoteCommandFuture(
'fetch origin %s --prune',
'+refs/heads/*:refs/heads/*',
require_once DIR . '../../../../ref_config_settings.php';
);

Would that work. And are the files above related to what I am trying to do.

I am trying to when phabricator is used as viewing a repo that is not in phabricator and is located for example on gerrit and you pull it from there it only does the changes that are on refs/heads not refs/changes even though that ref is for refs that have not been merged it is useful for example on Wikimedia phabricator which lets you see the changes before they are merged.

The ref_config_settings.php' file would look like this for example

'+refs/changes/*:refs/changes/*',

and would allow us to not hard code refs that aren't used by phabricator but other repos.

@epriestley I am not sure what I did fixes the problem or if I edited the wrong file.

@paladox: Please test your patches yourself first, before making reviewers spend their time.

@epriestley I am not sure what I did fixes the problem or if I edited the wrong file.

@paladox: Please test your patches yourself first, before making reviewers spend their time.

I carn't since not sure how to run it on php and I think it needs script to start it.

avivey added a subscriber: avivey.Dec 18 2015, 10:02 PM

@paladox: Please test your patches yourself first, before making reviewers spend their time.

I carn't since not sure how to run it on php and I think it needs script to start it.

In that case, it's very unlikely that your contributions would be accepted (Or even seriously reviewed). Please read Contributing Code for the guidelines. Everybody (And especially epriestley) are just too busy to do the testing for you.
Other than that, this feature is not likely to be accepted to the upstream, because it doesn't fit with the upstream's goals. See your local admin about local patches.