status output during clone

Adrian Buehlmann adrian at cadifra.com
Fri Oct 16 19:51:18 UTC 2009


Would it be useful to print the name of the checked-out branch
on clone?

Proposal (examples):

$ hg clone thg#stable thg-stable
requesting all changes
adding changesets
adding manifests
adding file changes
added 3538 changesets with 5457 changes to 522 files
checking out stable branch
297 files updated, 0 files merged, 0 files removed, 0 files unresolved

$ hg clone thg thg-clone
checking out default branch
310 files updated, 0 files merged, 0 files removed, 0 files unresolved


I think this would increase awareness of users for what branch
is checked out when cloning. Especially the fact that clone checks
out the _default branch_ by default.


Currently, we always just see "updating working directory"
while the files are checked out (examples):

$ hg clone thg#stable thg-stable
requesting all changes
adding changesets
adding manifests
adding file changes
added 3538 changesets with 5457 changes to 522 files
updating working directory
297 files updated, 0 files merged, 0 files removed, 0 files unresolved

$ hg clone thg thg-clone
updating working directory
310 files updated, 0 files merged, 0 files removed, 0 files unresolved


Tentative patch:

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -307,7 +307,6 @@ def clone(ui, source, dest=None, pull=Fa
             dest_repo.ui.setconfig('paths', 'default', abspath)

             if update:
-                dest_repo.ui.status(_("updating working directory\n"))
                 if update is not True:
                     checkout = update
                 for test in (checkout, 'default', 'tip'):
@@ -318,6 +317,8 @@ def clone(ui, source, dest=None, pull=Fa
                         break
                     except error.RepoLookupError:
                         continue
+                bn = dest_repo[uprev].branch()
+                dest_repo.ui.status(_("checking out %s branch\n") % bn)
                 _update(dest_repo, uprev)

         return src_repo, dest_repo



More information about the Mercurial-devel mailing list