From 350cde4c4bec5e7b5776cf52d61da600af3efc31 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Thu, 16 Apr 2009 11:21:18 -0700 Subject: Change repo sync to be more friendly when updating the tree We now try to sync all projects that can be done safely first, before we start rebasing user commits over the upstream. This has the nice effect of making the local tree as close to the upstream as possible before the user has to start resolving merge conflicts, as that extra information in other projects may aid in the conflict resolution. Informational output is buffered and delayed until calculation for all projects has been done, so that the user gets one concise list of notice messages, rather than it interrupting the progress meter. Fast-forward output is now prefixed with the project header, so the user can see which project that update is taking place in, and make some relation of the diffstat back to the project name. Rebase output is now prefixed with the project header, so that if the rebase fails, the user can see which project we were operating on and can try to address the failure themselves. Since rebase sits on a detached HEAD, we now look for an in-progress rebase during sync, so we can alert the user that the given project is in a state we cannot handle. Signed-off-by: Shawn O. Pearce --- subcmds/init.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'subcmds/init.py') diff --git a/subcmds/init.py b/subcmds/init.py index a32eaae0..103a78d6 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -20,6 +20,7 @@ from color import Coloring from command import InteractiveCommand, MirrorSafeCommand from error import ManifestParseError from remote import Remote +from project import SyncBuffer from git_command import git, MIN_GIT_VERSION class Init(InteractiveCommand, MirrorSafeCommand): @@ -129,7 +130,10 @@ default.xml will be used. print >>sys.stderr, 'fatal: cannot obtain manifest %s' % r.url sys.exit(1) - m.Sync_LocalHalf() + syncbuf = SyncBuffer(m.config) + m.Sync_LocalHalf(syncbuf) + syncbuf.Finish() + if is_new or m.CurrentBranch is None: if not m.StartBranch('default'): print >>sys.stderr, 'fatal: cannot create default in manifest' -- cgit v1.2.3-54-g00ecf