bundle: fix error for --all with destination
Before it complained about --base
bundle: clarify help text
The file might not be compressed; the interactions between
-a, --base, and a named or default repository weren't clear.
cmdutil: do not duplicate stdout by makefileobj()
It made output order unpredictable because two separate buffers are flushed
individually. Let's use a thin wrapper that just sends close() to black hole.
cmdutil: reimplement file wrapper that disables close()
There's no need to dynamically create wrappedfileobj class and define
close() as lambda. Also, __iter__() was missing.
export: remove useless comparison between file object and string
It was introduced at
31aa2e5b0750, where "template" argument could be a file
object. After that,
a306837f8c87 added "len(template)", so "template" must be
a string now. Therefore, "fp != template" should always be True.
It seems
31aa2e5b0750 was intended to work around a bug in TortoiseHg, and
I'm sure I've fixed it completely in TortoiseHg source.
https://selenic.com/pipermail/mercurial-devel/2011-February/028467.html
export: do not print '<fdopen>' as an output filename
Because makefileobj() duplicates or wraps stdout, "fp != sys.stdout" didn't
work correctly. Python doc states that special file objects are named in the
form '<...>', and absolute filenames should never start with '<', we can
ignore names start with '<'. We can't test fp.fileno() because fp may be a
command-server channel.
https://docs.python.org/2.7/library/stdtypes.html#file.name
In the test output, "exporting patch:" line is printed after patch content.
This is caused by fdopen() and will be fixed by the subsequent patch.
commandserver: implement name() to clarify channel is not a plain file
Because unknown attributes are delegated to the underlying file object,
commandserver channels said they were '<stdout>' or '<stdin>' even though
they weren't. This patch makes them say '<X-channel>'.
histedit: delete to drop
The default behaviour to forbid this makes a lot of sense for novice users
because it's safeguarding them from dangerous behavior but making it
configurable will be apprieciated by power users in at least one big
organization.
It allows an user to look an histedit rules from declarative perspective and
make the rules reflect the state after histedit. If we can move lines t move
commits why can't we drop lines to drop commits?
Let's put this behind config knob and inform users about this feature the very
moment they are trying to use it so they can choose desired behaviour.