subrepo: drop the '_ui' member in the subrepo subclasses

This member has existed in the base class since fcbc66b5da6a.

--HG--
extra : rebase_source : 3c440ffaf5e565a93a809f79e7bf3d9917ff1376
subrepo: rename the '_ui' member to 'ui'

The localrepository class has a 'ui' member, so keeping the names the same will
allow for duck typing with subrepo instances when accessing 'ui'.  Changing this
is easier than finding all of the localrepository instance uses and renaming
that to '_ui'.

--HG--
extra : rebase_source : 0efcdaf93684b5360cef9e79a21240b7bb76da8a
subrepo: reset 'self.ui' to the subrepo copy of 'ui' in the hgsubrepo class

Creation of the subrepo's '_repo' object creates a new 'ui' by combining the
parent repo's 'baseui' and reading in the subrepo's hgrc file.  This simply
avoids 'self.ui' and 'self._repo.ui' pointing to different objects, which seems
like a potential source of bugs.

Git and Svn subrepos are unchanged, because they don't have their own ui, and
have always used their parent's for their configuration.

--HG--
extra : rebase_source : 4f249e7c9f9f31f1e3091513c64d175b003b9394
subrepo: use 'self.ui' instead of 'self._repo.ui'

They are now equivalent, but the former is slightly more readable.

--HG--
extra : rebase_source : dcbb4f0ebc046307c6448d78975c624da104ffd0
subrepo: drop the 'ui' parameter to archive()

The current state of subrepo methods is to pass a 'ui' object to some methods,
which has the effect of overriding the subrepo configuration since it is the
root repo's 'ui' that is passed along as deep as there are subrepos.  Other
subrepo method are *not* passed the root 'ui', and instead delegate to their
repo object's 'ui'.  Even in the former case where the root 'ui' is available,
some methods are inconsistent in their use of both the root 'ui' and the local
repo's 'ui'.  (Consider hg._incoming() uses the root 'ui' for path expansion
and some status messages, but also calls bundlerepo.getremotechanges(), which
eventually calls discovery.findcommonincoming(), which calls
setdiscovery.findcommonheads(), which calls status() on the local repo 'ui'.)

This inconsistency with respect to the configured output level is probably
always hidden, because --verbose, --debug and --quiet, along with their 'ui.xxx'
equivalents in the global and user level hgrc files are propagated from the
parent repo to the subrepo via 'baseui'.  The 'ui.xxx' settings in the parent
repo hgrc file are not propagated, but that seems like an unusual thing to set
on a per repo config file.  Any 'ui.xxx' options changed by --config are also
not propagated, because they are set on repo.ui by dispatch.py, not repo.baseui.

The goal here is to cleanup the subrepo methods by dropping the 'ui' parameter,
which in turn prevents mixing subtly different 'ui' instances on a given subrepo
level.  Some methods use more than just the output level settings in 'ui' (add
for example ends up calling scmutil.checkportabilityalert() with both the root
and local repo's 'ui' at different points).  This series just goes for the low
hanging fruit and switches methods that only use the output level.

If we really care about not letting a subrepo config override the root repo's
output level, we can propagate the verbose, debug and quiet settings to the
subrepo in the same way 'ui.commitsubrepos' is in hgsubrepo.__init__.

Archive only uses the 'ui' object to call its progress() method, and gitsubrepo
calls status().

--HG--
extra : rebase_source : b3900715ddf9941258456afe3301abc6f2646a72
subrepo: drop the 'ui' parameter to cat()

This no longer needs to be explicitly passed because the subrepo object tracks
a 'ui' reference since fcbc66b5da6a.  See the change to 'archive' for details
about the differences between the output level in the root repo and subrepo 'ui'
object.

The only use for 'ui' in cat is to emit a status message when a subrepo is
missing.  The bad() method on the matcher still uses the root repo's ui, because
narrowing the matcher doesn't change the ui object.

--HG--
extra : rebase_source : 3e656095b19129030c578ebca41f07769b39f336
subrepo: drop the 'ui' parameter to forget()

This no longer needs to be explicitly passed because the subrepo object tracks
the 'ui' reference since fcbc66b5da6a.  See the change to 'archive' for details
about the differences between the output level in the root repo and subrepo 'ui'
object.

The only use for 'ui' in forget is to emit status and warning messages, and to
check the verbose flag prior to printing files to be forgotten.  The bad()
method on the matcher still uses the root repo's ui, because narrowing the
matcher doesn't change the ui object.

The local repo's ui was already being used to print a warning message in
wctx.forget() and for 'ui.slash' when walking dirstate in the repo.status()
call.

--HG--
extra : rebase_source : 70a88df85324a8235f771bb4c230a0175ac2246b
subrepo: drop the 'ui' parameter to removefiles()

This no longer needs to be explicitly passed because the subrepo object tracks
the 'ui' reference since fcbc66b5da6a.  See the change to 'archive' for details
about the differences between the output level in the root repo and subrepo 'ui'
object.

The only use for 'ui' in remove is to emit status and warning messages, and to
check the verbose flag prior to printing files to be removed.  The bad() method
on the matcher still uses the root repo's ui, because narrowing the matcher
doesn't change the ui object.

The local repo's ui was already being used to print a warning message in
wctx.forget() and for 'ui.slash' when walking dirstate in the repo.status()
call.

--HG--
extra : rebase_source : e893e967ab454cbdf3cbcc1501148568a6dfeccd
subrepo: drop the 'ui' parameter to revert()

This no longer needs to be explicitly passed because the subrepo object tracks
the 'ui' reference since fcbc66b5da6a.  See the change to 'archive' for details
about the differences between the output level in the root repo and subrepo 'ui'
object.

The only use for 'ui' in revert is to emit status and warning messages, and to
check the verbose flag prior to printing the action to be performed on a file.

The local repo's ui was already being used to print a warning message in
wctx.forget() and for 'ui.slash' when walking dirstate in the repo.status()
call.  Unlike other methods where the matcher is passed along and narrowed, a
new matcher is created in each repo, and therefore the bad() method already used
the local repo's ui.

--HG--
extra : rebase_source : adbe720bfcb25454691b0abb7996855c755b5b84
subrepo: fix git subrepo ui argument