monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] diff --reverse?


From: Stephen Leake
Subject: [Monotone-devel] diff --reverse?
Date: Mon, 13 Jul 2009 19:39:23 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt)

I'd like to add a '--reverse' option to diff.

The use case: I'm reviewing a list of commits by others on my team.
They are all newer than my current workspace. So I want to see changes
_from_ my workspace _to_ a given rev. Currently, 'diff rev' shows
changes _from_ the rev _to_ the workspace (which is appropriate in
other use cases).

I've edited (on branch nvm.stephe, but monotone.ca mtn server is still
down) cmd_diff_log.cc prepare_diff, so it now does:

      if (app.opts.reverse)
        {
          // FIXME: this breaks something in graph.cc
          make_cset(new_roster, restricted_roster, excluded);
          make_cset(restricted_roster, old_roster, included);
        }
      else
        {
          make_cset(old_roster, restricted_roster, included);
          make_cset(restricted_roster, new_roster, excluded);
        }

But this breaks an invariant in graph.cc when app.opts.reverse is
true.

I have two questions:

1) 'excluded' is a local variable; it is _not_ returned to the caller.
'included' is returned to the caller. Yet it seems that 'excluded'
contains the diff they are interested in! How does this work? Why are
we building two csets, but only returning one of them?

2) Any suggestions for fixing this? I'll investigate graph.cc myself,
but I'm hoping someone has some pertinent advice.

-- 
-- Stephe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]