Homec4science

PhabricatorRepository: temporarily change the localPath

Authored by Edward Speyer <edward@fb.com> on Mar 8 2012, 04:48.

Description

PhabricatorRepository: temporarily change the localPath

Summary:
I'm on a host where I have the PhabricatorRepositoryPullLocalDaemons
tracking a remote repo. In my case, these end up as local git repos in
/var/repo/$name.

I'm working on another daemon that is going to automatically make
changes and commit them back upstream. I figured it would be best to do
this in a new local repo. I'll put these in /var/repo-clones/$name.

It's nice to use the exec*() functions in PhabricatorRepository, so the
approach I thought of was to load the PhabricatorRepository object from
the database, then change its localPath to point at the
/var/repo-clones/$name directory instead.

I didn't really want to change the local-path detail with setDetail(),
as that risks committing the change upstream. It's nice to use the
repo's execLocalCommand() methods though, hence wanting to change the
local path.

Test Plan: None yet.

Reviewers: epriestley

CC: aran, epriestley

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

Details

Committed
Edward Speyer <edward@fb.com>Mar 9 2012, 00:15
Pushed
aubortJan 31 2017, 17:16
Parents
rPH89dac1cf195a: When updating git repositories, use --prune to prune old branches
Branches
Unknown
Tags
Unknown

Event Timeline

Edward Speyer <edward@fb.com> committed rPH579941b866f2: PhabricatorRepository: temporarily change the localPath (authored by Edward Speyer <edward@fb.com>).Mar 9 2012, 00:15