Skip to content

'exclude' line in view- applies to all lines after #26

@xrouge

Description

@xrouge

The following lines won't generate a spec as intended:

views:
- src: -//depot/source_pathA/...
  targ: //import/target_pathA/...
- src: //depot/source_pathA/pathX/...
  targ: //import/target_pathA/pathX/...

will result in:

-//depot/source_pathA/...  //import/target_pathA/...
-//depot/source_pathA/pathX/... //import/target_pathA/pathX/...

pathA should be excluded, but pathX should be included. However the setting to '' before the for loop means that once an exclude line is encountered, all subsequent ones will be excluded:

        else:   # Ordinary workspace views which allow exclusions
            exclude = ''
            for v in self.options.views:
                lhs = v['src']
                if lhs[0] == '-':
                    exclude = '-'

The code should probably reset exclude to '' inside the loop:

        else:   # Ordinary workspace views which allow exclusions
            for v in self.options.views:
                lhs = v['src']
                if lhs[0] == '-':
                    exclude = '-'
                    lhs = lhs[1:]
                else:
                    exclude = ''

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions