Commit Graph

8 Commits

Author SHA1 Message Date
Ben Alpert
56e0b352ae dirsync: Behave better with already-inconsistent mirror
Summary:
If a mirror of a file is missing, dirsync now behaves better:

- When deleting the source, it allows the commit and does no mirroring since the two paths are already in sync (previously, it raised an exception when trying to delete the mirror)
- When updating the source, it creates a file in the mirrored location to match
- When updating (creating) the mirrored file, the source (which already exists) is updated too

Fixes https://www.facebook.com/groups/sourcecontrol/permalink/929877003728587/.

Test Plan: `../../hg/tests/run-tests.py test-dirsync.t`

Reviewers: #sourcecontrol, durham, lcharignon, ttung

Reviewed By: durham

Subscribers: poshannessy, mjpieters, durham

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

Signature: t1:2794928:1456446576:c18d06a42eb89b5168c25d048ba4fa1fa3f0c6d3
2016-02-25 16:50:43 -08:00
Laurent Charignon
95f1498273 cleanup: make test-dirsync.t pass check code
Summary:
I missed this one as I was working on top of the release branch and it
changed under @

Test Plan: all tests that were passing before pass and check code passes

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2814605
2016-01-11 10:19:22 -08:00
Laurent Charignon
0ca941a08a cleanup: use backtick instead of parent to capture output of shell cmd
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, mitrandir, akushner

Reviewed By: akushner

Subscribers: mpm, akushner, mitrandir

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

Signature: t1:2811997:1452200059:9e4fca501a22f95d2d9a22d234758f55e292ea9a
2016-01-07 18:30:24 -08:00
Laurent Charignon
5ebc03718c cleanup: fix quoting patterns in tests
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/D2811856
2016-01-07 18:30:24 -08:00
Michael Lee
5ed662ae76 [dirsync] Remove dirsync mirroring message
Summary:
^^^

https://fb.facebook.com/groups/sourcecontrol/permalink/932848996764721/

Test Plan:
    ../../hg-crew/tests/run-tests.py test-dirsync.t

Reviewers: lcharignon, durham

Reviewed By: durham

Subscribers: seanc, knekritz

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

Tasks: 9584342

Signature: t1:2802500:1452026176:4813992ae1f42836d30921a4a1e79e86a01ce52b
2016-01-05 16:52:13 -05:00
Durham Goode
9b444e63df dirsync: fix extramatches function
Summary:
matchfn actually accepts just a single argument (the file name), so our
extramatches function was incorrect. The test didn't hit it because the matcher
had no patterns (it only had explicit files), so it never executed the matchfn.

Test Plan: I updated the tests with a pattern to force this code path to be hit.

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2750982
2015-12-11 14:46:29 -08:00
Durham Goode
14f794444a dirsync: fix 'hg commit file.txt'
Summary:
Previously, only commiting/amending a certain file would break the dirsync,
since it would apply the mirror to the working copy but it would not perform the
amend.

The fix is to extend the commit's matcher to include the files that are mirrors
of what is already being included in the commit.

Test Plan: Added tests

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2696486
2015-11-25 11:21:47 -08:00
Durham Goode
175f3b3410 dirsync: add extension for keeping directories synchronized
Summary:
This adds an extension that allows configuring the repository such that any
commit that touches a file in directory foo/ will also have the change applied
to directory bar/. It will also block commits if they try to make divergent
changes to mirrored directories.

Test Plan: Added a test suite

Reviewers: #sourcecontrol

Subscribers: chip, aponomarenko

Differential Revision: https://phabricator.fb.com/D2602592
2015-10-30 15:37:17 -07:00