Skip to content

Deleted Business Item reappears #883

@cambot

Description

@cambot

We recently did some cleanup on our main branch and removed some obsolete business items. We had someone with a feature branch that started off of the main branch before these items were deleted. Switching to this branch restores the items, but changing back to the main branch leaves them hanging around.

  • From the output window, I can see that SourceControl.Git.Utils.ParseDiffStream() is not getting an internal name (NameToInternalName()) for the deleted file name.
  • Since the git-checkout command removed the file from the file system, NameToInternalName() falls through the internal name lookups and attempts to manually construct the internal name.
  • It fails to match the external name to the PTD mapping because it checks the file extension, which is xml, not ptd. the other conditions are not met, so it thinks it has not found a mapping match:
If ($ZConvert(subscript, "U") = $ZConvert($Piece(name, ".", *), "U")) {    // <<< bug 
    Set extScore = 1
} ElseIf (subscript = "/CSP/") {
    Set extScore = 1
} Else {
    Set extScore = 0
}

I'm not sure what the best solution is here. My first guess is adding an Else condition:

ElseIf ( (subscript = "PTD") && (fileExtension = "xml") {
    Set extScore = 1
}

because there is no guarantee that "ptd" will occur within the external file name.

While you are at it, obtaining the file extension is a loop invariant. You can cache that before the while loop:

Set fileExtension = $ZConvert($Piece(name, ".", *), "U")
While ... {
}

I'm sure it's not costing much in the way of performance right now (my project currently has 8 mappings), but every little bit helps.


Module Version: 2.13.1

Metadata

Metadata

Assignees

Labels

customerBased on customer feedback (as opposed to something identified by developers)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions