Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xrouge opened this issue Jul 6, 2024 · 0 comments
Open

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

xrouge opened this issue Jul 6, 2024 · 0 comments

Comments

@xrouge
Copy link

xrouge commented Jul 6, 2024

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 = ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant