##// END OF EJS Templates
scmutil: unify some 'no changes found' messages...
Matt Mackall -
r15993:0b05e0bf stable
parent child Browse files
Show More
@@ -983,6 +983,7 b' def bundle(ui, repo, fname, dest=None, *'
983 common = [repo.lookup(rev) for rev in base]
983 common = [repo.lookup(rev) for rev in base]
984 heads = revs and map(repo.lookup, revs) or revs
984 heads = revs and map(repo.lookup, revs) or revs
985 cg = repo.getbundle('bundle', heads=heads, common=common)
985 cg = repo.getbundle('bundle', heads=heads, common=common)
986 outgoing = None
986 else:
987 else:
987 dest = ui.expandpath(dest or 'default-push', dest or 'default')
988 dest = ui.expandpath(dest or 'default-push', dest or 'default')
988 dest, branches = hg.parseurl(dest, opts.get('branch'))
989 dest, branches = hg.parseurl(dest, opts.get('branch'))
@@ -994,11 +995,7 b' def bundle(ui, repo, fname, dest=None, *'
994 force=opts.get('force'))
995 force=opts.get('force'))
995 cg = repo.getlocalbundle('bundle', outgoing)
996 cg = repo.getlocalbundle('bundle', outgoing)
996 if not cg:
997 if not cg:
997 if 'outgoing' in locals() and outgoing.excluded:
998 scmutil.nochangesfound(ui, outgoing and outgoing.excluded)
998 repo.ui.status(_("no changes found but %i secret changesets\n")
999 % len(outgoing.excluded))
1000 else:
1001 ui.status(_("no changes found\n"))
1002 return 1
999 return 1
1003
1000
1004 bundletype = opts.get('type', 'bzip2').lower()
1001 bundletype = opts.get('type', 'bzip2').lower()
@@ -10,7 +10,7 b' from i18n import _'
10 from lock import release
10 from lock import release
11 from node import hex, nullid
11 from node import hex, nullid
12 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo, bookmarks
12 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo, bookmarks
13 import lock, util, extensions, error, node
13 import lock, util, extensions, error, node, scmutil
14 import cmdutil, discovery
14 import cmdutil, discovery
15 import merge as mergemod
15 import merge as mergemod
16 import verify as verifymod
16 import verify as verifymod
@@ -511,11 +511,7 b' def _outgoing(ui, repo, dest, opts):'
511 force=opts.get('force'))
511 force=opts.get('force'))
512 o = outgoing.missing
512 o = outgoing.missing
513 if not o:
513 if not o:
514 if outgoing.excluded:
514 scmutil.nochangesfound(repo.ui, outgoing.excluded)
515 repo.ui.status(_("no outgoing changes but %i secret changesets\n")
516 % len(outgoing.excluded))
517 else:
518 ui.status(_("no changes found\n"))
519 return None
515 return None
520 return o
516 return o
521
517
@@ -1629,11 +1629,7 b' class localrepository(repo.repository):'
1629
1629
1630 if not outgoing.missing:
1630 if not outgoing.missing:
1631 # nothing to push
1631 # nothing to push
1632 if outgoing.excluded:
1632 scmutil.nochangesfound(self.ui, outgoing.excluded)
1633 msg = "no changes to push but %i secret changesets\n"
1634 self.ui.status(_(msg) % len(outgoing.excluded))
1635 else:
1636 self.ui.status(_("no changes found\n"))
1637 ret = 1
1633 ret = 1
1638 else:
1634 else:
1639 # something to push
1635 # something to push
@@ -10,6 +10,14 b' import util, error, osutil, revset, simi'
10 import match as matchmod
10 import match as matchmod
11 import os, errno, re, stat, sys, glob
11 import os, errno, re, stat, sys, glob
12
12
13 def nochangesfound(ui, secretlist=None):
14 '''report no changes for push/pull'''
15 if secretlist:
16 ui.status(_("no changes found (ignored %d secret changesets)\n")
17 % len(secretlist))
18 else:
19 ui.status(_("no changes found\n"))
20
13 def checkfilename(f):
21 def checkfilename(f):
14 '''Check that the filename f is an acceptable filename for a tracked file'''
22 '''Check that the filename f is an acceptable filename for a tracked file'''
15 if '\r' in f or '\n' in f:
23 if '\r' in f or '\n' in f:
@@ -44,7 +44,7 b' Bundle and phase'
44 $ hg -R test phase --force --secret 0
44 $ hg -R test phase --force --secret 0
45 $ hg -R test bundle phase.hg empty
45 $ hg -R test bundle phase.hg empty
46 searching for changes
46 searching for changes
47 no changes found but 9 secret changesets
47 no changes found (ignored 9 secret changesets)
48 [1]
48 [1]
49 $ hg -R test phase --draft -r 'head()'
49 $ hg -R test phase --draft -r 'head()'
50
50
@@ -405,7 +405,7 b' test outgoing with secret changesets'
405 $ hg -R test-dev outgoing test
405 $ hg -R test-dev outgoing test
406 comparing with test
406 comparing with test
407 searching for changes
407 searching for changes
408 no outgoing changes but 5 secret changesets
408 no changes found (ignored 5 secret changesets)
409 [1]
409 [1]
410 $ hg -R test-dev phase --draft -r 'head()'
410 $ hg -R test-dev phase --draft -r 'head()'
411
411
@@ -149,7 +149,7 b' All secret'
149 $ hg push -r . ../forcepush2
149 $ hg push -r . ../forcepush2
150 pushing to ../forcepush2
150 pushing to ../forcepush2
151 searching for changes
151 searching for changes
152 no changes to push but 1 secret changesets
152 no changes found (ignored 1 secret changesets)
153
153
154 some draft
154 some draft
155
155
@@ -183,7 +183,7 b' Pushing applied patch with --force'
183 $ hg push --force -r default ../forcepush2
183 $ hg push --force -r default ../forcepush2
184 pushing to ../forcepush2
184 pushing to ../forcepush2
185 searching for changes
185 searching for changes
186 no changes to push but 1 secret changesets
186 no changes found (ignored 1 secret changesets)
187 $ hg phase --draft 'mq()'
187 $ hg phase --draft 'mq()'
188 $ hg push --force -r default ../forcepush2
188 $ hg push --force -r default ../forcepush2
189 pushing to ../forcepush2
189 pushing to ../forcepush2
General Comments 0
You need to be logged in to leave comments. Login now