New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RF: Dedicated method to perform a local annex sync #4243
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4243 +/- ##
==========================================
+ Coverage 89.45% 89.81% +0.35%
==========================================
Files 275 275
Lines 36328 40014 +3686
==========================================
+ Hits 32498 35938 +3440
- Misses 3830 4076 +246
Continue to review full report at Codecov.
|
To consolidate corresponding branches and sync 'git-annex' branches of one or more given, or all remotes. Does not leave behind 'synced/...' branches, unless they existed prior calling the method.
datalad/support/annexrepo.py
Outdated
@@ -3476,24 +3465,56 @@ def _save_post(self, message, status, partial_commit): | |||
# first do standard GitRepo business | |||
super(AnnexRepo, self)._save_post( | |||
message, status, partial_commit) | |||
# check if we have to deal with adjusted branch | |||
# then sync potential managed branches | |||
self.localsync() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "is corresponding branch" conditional is now removed from localsync
, so shouldn't _save_post
do it to avoid unnecessary sync
calls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Although I spent a day trying graps all the combinations, and I am still not done. So....we'll see....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will introduce a managed_only=False
parameter that allows for triggering the test from the outside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. And it looks like being able to avoid annex sync
is necessary to prevent merge conflict failures like the one now happening in test_rerun. Here's a reduced script that will trigger such a conflict without datalad:
conflict demo
#!/bin/sh
set -eux
cd "$(mktemp -d --tmpdir gx-XXXXXXX)"
git init
git annex init
echo foo >foo
git annex add foo
git commit -mfoo
git annex unlock foo
echo more >>foo
git annex add foo
git commit -m"foo more"
git annex sync --no-pull --no-push --no-commit --no-resolvemerge
git reset --hard HEAD~1
git annex unlock foo
echo different more >>foo
git annex add foo
git commit -m"foo different more"
git annex sync --no-pull --no-push --no-commit --no-resolvemerge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed that change. Need to detach now till some time next week.
Otherwise it would not consolidate git-annex branches across remotes. If localsync() is called for syncing managed branches only, this should be tested upfront and outside (e.g. is_managed_branch()).
I think this is now in a better place, so keep those coming! ;-) |
Per request in #4206 (comment)
To consolidate corresponding branches and sync 'git-annex' branches of
one or more given, or all remotes. Does not leave behind 'synced/...'
branches, unless they existed prior calling the method.