Mercurial > hg > hg-git
diff hggit/git_handler.py @ 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 |
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')