[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

What's the responsibility of parse_next_hunk()?

From: Daniel Näslund <daniel_at_longitudo.com>
Date: Wed, 14 Jul 2010 14:44:23 +0200

Hi!

I just realized that parse_next_hunk() at present only detects a property
hunk if it has a property header ('Added', 'Deleted', 'Modified')
directly preceeding it. The second hunk won't know what propname it
belongs to.

We previously had diff headers and hunk headers. The property header is
only set before the first hunk and is thus not the same sort as any of
the two previous ones.

What should parse_next_hunk() do to properly handle property hunks?
---------------------------------------------------------------------
  Alternative 1
  Fetch the next hunk and tell the caller if it's a property or a text
  hunk. (let it be up to the caller to remember what the last prop_name
  was)

  Alternative 2
  Keep track of if we're currently below a property header (and hasn't
  seen any text hunks since that property header). That means passing
  around a 'prop_name' variable that would be set to NULL if the previous hunk
  was a text hunk and otherwise have the value of the last parsed
  property name.

Any suggestions?

Thanks,
Daniel
Received on 2010-07-14 14:45:58 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.