diff options
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/sync.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index ec333ae7..a8074a40 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -119,6 +119,11 @@ credentials. | |||
| 119 | The -f/--force-broken option can be used to proceed with syncing | 119 | The -f/--force-broken option can be used to proceed with syncing |
| 120 | other projects if a project sync fails. | 120 | other projects if a project sync fails. |
| 121 | 121 | ||
| 122 | The --force-sync option can be used to overwrite existing git | ||
| 123 | directories if they have previously been linked to a different | ||
| 124 | object direcotry. WARNING: This may cause data to be lost since | ||
| 125 | refs may be removed when overwriting. | ||
| 126 | |||
| 122 | The --no-clone-bundle option disables any attempt to use | 127 | The --no-clone-bundle option disables any attempt to use |
| 123 | $URL/clone.bundle to bootstrap a new Git repository from a | 128 | $URL/clone.bundle to bootstrap a new Git repository from a |
| 124 | resumeable bundle file on a content delivery network. This | 129 | resumeable bundle file on a content delivery network. This |
| @@ -174,6 +179,11 @@ later is required to fix a server side protocol bug. | |||
| 174 | p.add_option('-f', '--force-broken', | 179 | p.add_option('-f', '--force-broken', |
| 175 | dest='force_broken', action='store_true', | 180 | dest='force_broken', action='store_true', |
| 176 | help="continue sync even if a project fails to sync") | 181 | help="continue sync even if a project fails to sync") |
| 182 | p.add_option('--force-sync', | ||
| 183 | dest='force_sync', action='store_true', | ||
| 184 | help="overwrite an existing git directory if it needs to " | ||
| 185 | "point to a different object directory. WARNING: this " | ||
| 186 | "may cause loss of data") | ||
| 177 | p.add_option('-l', '--local-only', | 187 | p.add_option('-l', '--local-only', |
| 178 | dest='local_only', action='store_true', | 188 | dest='local_only', action='store_true', |
| 179 | help="only update working tree, don't fetch") | 189 | help="only update working tree, don't fetch") |
| @@ -281,6 +291,7 @@ later is required to fix a server side protocol bug. | |||
| 281 | success = project.Sync_NetworkHalf( | 291 | success = project.Sync_NetworkHalf( |
| 282 | quiet=opt.quiet, | 292 | quiet=opt.quiet, |
| 283 | current_branch_only=opt.current_branch_only, | 293 | current_branch_only=opt.current_branch_only, |
| 294 | force_sync=opt.force_sync, | ||
| 284 | clone_bundle=not opt.no_clone_bundle, | 295 | clone_bundle=not opt.no_clone_bundle, |
| 285 | no_tags=opt.no_tags, archive=self.manifest.IsArchive, | 296 | no_tags=opt.no_tags, archive=self.manifest.IsArchive, |
| 286 | optimized_fetch=opt.optimized_fetch) | 297 | optimized_fetch=opt.optimized_fetch) |
| @@ -696,7 +707,7 @@ later is required to fix a server side protocol bug. | |||
| 696 | for project in all_projects: | 707 | for project in all_projects: |
| 697 | pm.update() | 708 | pm.update() |
| 698 | if project.worktree: | 709 | if project.worktree: |
| 699 | project.Sync_LocalHalf(syncbuf) | 710 | project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync) |
| 700 | pm.end() | 711 | pm.end() |
| 701 | print(file=sys.stderr) | 712 | print(file=sys.stderr) |
| 702 | if not syncbuf.Finish(): | 713 | if not syncbuf.Finish(): |
