[PATCH 4 of 4] changeset_printer: hide manifest node for workingctx

Yuya Nishihara yuya at tcha.org
Fri Apr 3 08:31:32 CDT 2015


On Thu, 02 Apr 2015 15:39:08 -0500, Matt Mackall wrote:
> It's worth considering defining __cmp__ on ctxs. Obviously the semantics
> of ctxa < ctxb are not a perfect match for a mere partial ordering.. but
> we do have a partial ordering that we regularly use as a shortcut and we
> should make it convenient.

Is your suggestion something like this?

  def __cmp__(self, other):
      return cmp(intrev(self), intrev(other))

or

  def __cmp__(self, other):
      if self == other:
          return 0
      elif other in self.ancestors():  # naive implementation
          return -1
      else:
          return 1

I agree it will be sometimes convenient, but I'm not sure how often we'll
do "ctxa < ctxb".

Regards,


More information about the Mercurial-devel mailing list