Ticket #3141 (closed defect: duplicate)

Opened 6 months ago

Last modified 4 months ago

submodule handling

Reported by: anonymous Assigned to: hvr
Priority: normal Component: GitPlugin
Severity: normal Keywords: submodule
Cc: Trac Release: 0.11

Description

the code breaks at some places in git_fs, on commits having submodule changes. the first one i found is get_content_length returning None, and then trac trying to sum Nones. a quick workaround is changing

if not self.isfile:
  return None

to

if not self.isfile:
  return 0

the second is in get_changes. submodule changes have a different mode than directory changes, so they end up with kind = file, and trac tries to read the content. my workaround is changing the condition

if mode2.startswith('04') or mode1.startswith('04'):
  kind = Node.DIRECTORY

to

if mode2.startswith('04') or mode1.startswith('04') or mode1.startswith('16'):
  kind = Node.DIRECTORY

so these changes are treated like directory changes.

these are just some quick hacks, but they make the plugin usable on repos with submodules, until there's a better solution.

Attachments

Change History

(in reply to: ↑ description ) 06/07/08 09:43:16 changed by anonymous

  • keywords set to submodule.

Replying to anonymous:

the code breaks at some places in git_fs, on commits having submodule changes. the first one i found is get_content_length returning None, and then trac trying to sum Nones. a quick workaround is changing {{{ if not self.isfile: return None }}} to {{{ if not self.isfile: return 0 }}} the second is in get_changes. submodule changes have a different mode than directory changes, so they end up with kind = file, and trac tries to read the content. my workaround is changing the condition {{{ if mode2.startswith('04') or mode1.startswith('04'): kind = Node.DIRECTORY }}} to {{{ if mode2.startswith('04') or mode1.startswith('04') or mode1.startswith('16'): kind = Node.DIRECTORY }}} so these changes are treated like directory changes. these are just some quick hacks, but they make the plugin usable on repos with submodules, until there's a better solution.

08/17/08 05:02:46 changed by anonymous

  • status changed from new to closed.
  • resolution set to duplicate.

see also #3104


Add/Change #3141 (submodule handling)




Change Properties
Action