changeset 702:178b15457927

git_handler: base 'no changes found' message on commits, not on heads Since Mercurial is commit-oriented, the 'no changes found' message really should rely on what new commits are in the repo, not on new heads. This also makes an upcoming patch much simpler. Since everything around this code is completely broken anyway, writing a test for this that doesn't trigger other bugs is close to impossible. An upcoming patch will include tests. The test output change is for an empty clone -- the output is precisely how vanilla Mercurial treats an empty clone.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 04 Mar 2014 15:43:54 -0800
parents e29e280776ff
children 439e57b724b6
files hggit/git_handler.py tests/test-clone.t
diffstat 2 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/git_handler.py
+++ b/hggit/git_handler.py
@@ -227,9 +227,6 @@
                     and not k.endswith('^{}')
                     and refs[k] != oldrefs.get(remoteref(k))]
 
-        if not modheads:
-            self.ui.status(_("no changes found\n"))
-
         self.save_map()
 
         return len(modheads)
@@ -640,6 +637,8 @@
         total = len(commits)
         if total:
             self.ui.status(_("importing git objects into hg\n"))
+        else:
+            self.ui.status(_("no changes found\n"))
 
         for i, csha in enumerate(commits):
             self.ui.progress('importing', i, total=total, unit='commits')
old mode 100755
new mode 100644
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -55,6 +55,5 @@
   $ git init empty
   Initialized empty Git repository in $TESTTMP/empty/.git/
   $ hg clone empty emptyhg
-  no changes found
   updating to branch default
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved