workingctx: eliminate remove function
Inlining it into it's last remaining call place in cmdutil.copy.
Note that cmdutil.copy is called with the wlock already held, so no additional
locking is needed to call util.unlinkpath.
We do not need to wrap the util.unlinkpath call into a try block, because
at that point we already know whether abssrc exists or not -- thanks to the
preceding util.copyfile call. Adding a new local 'srcexists' in cmdutil.copy
for that purpose.
hg debuginstall
$ hg debuginstall
Checking encoding (ascii)...
Checking installed modules (*/mercurial)... (glob)
Checking templates...
Checking commit editor...
Checking username...
No problems detected
hg debuginstall with no username
$ HGUSER= hg debuginstall
Checking encoding (ascii)...
Checking installed modules (*/mercurial)... (glob)
Checking templates...
Checking commit editor...
Checking username...
no username supplied (see "hg help config")
(specify a username in your configuration file)
1 problems detected, please check your install!
[1]