AcUtils
A high performance abstraction layer for AccuRev
|
When promoting elements to a stream, the error message "...name already exists in backing stream..." appears. What does this mean?
An element ID (EID) is an immutable unique identifier (number) assigned to the element when it is added to AccuRev. It allows AccuRev to keep track of the entire history of the element from the time it was first added to the depot should it undergo a name or location change, or made defunct. When two elements with the same name and location are added to the depot in disparate streams, when promoted up the stream hierarchy they will eventually collide. This situation is referred to as "evil twins". The error message indicates there are two elements with the same name and location but with different EID's. To fix evil twins:
diff
on the twins to make sure the good twin (the one that will prevail) has the correct content. Edit as needed.move
) the evil element and then defunct
it. Note that as a best practice, renaming should always be done before making an element defunct, even in cases that are not evil twins (see Note below). In the case of evil twins, rename the evil twin with the ".EVIL" extension. Otherwise add a descriptive extension to the element, for example ".OBSOLETE".Promote
the renamed-defunct evil twin. Then do one of the following steps, based on a or b: (missing)
. Right-click on the missing element, select Populate
and select Ok to bring it into your workspace.promote
an element into a stream with the same name as another element as long as the element in the stream has (defunct)(member)
status. In this case, the twin that is (defunct)(member)
is made (stranded)
thus allowing the promoted element with the same name to become the new active member in the stream. However, this can cause promotion problems later if a twin with the (stranded)
element's EID exists higher up in the stream hierarchy. This would require promoting the (stranded)
version before its twin can be promoted. The practice of renaming (move
) elements before their defunct-promote
operation helps alleviate this problem and is the reason for the recommendation in step 3 above.Diff Against... File on Disk is the only way to diff files that are evil twins. For example diff -v Stream1\1 -V Stream2\1 \.\Dir\foo.java
fails since internally it's implemented using the name -e
option and does not rely on depot-relative pathnames. This allows diff
to operate on files that have undergone namespace changes but (sadly) fails in the case of evil twins. AccuRev defect 26192, RFE 26215, Salesforce 00044449.
EvilTwins.exe
scans for the presence of evil twins in depots listed in EvilTwins.exe.config
. Add depot entries (case-sensitive) as needed. Program output is sent to EvilTwinsFound-YYYY-MM-DD.log
, a daily log file created/updated in the same folder where EvilTwins.exe
resides. The program's return value is zero (0) if it ran successfully or one (1) in the event of an exception or initialization failure. Program errors are sent to STDOUT and logged in %LOCALAPPDATA%\AcTools\Logs\EvilTwins-YYYY-MM-DD.log
.EvilTwins.exe.config
to keep them from being reported in the future. Empty lines are allowed in the exclude file and comments can be added by using the # sign as the first character of each comment line. The full path to the exclude file should be given as the value for key TwinsExcludeFile in EvilTwins.exe.config
. (Do not change the key name TwinsExcludeFile to some other name, otherwise the program will malfunction.)
\.\Mobile\LogManager.h EID: 4872 on Wed May 24 9:28 AM NEPTUNE_DEV2 (backed) Size: 411, ModTime: 8/3/2016 6:29:57 PM {text} Real: NEPTUNE_DEV2_thomas\5, Virtual: NEPTUNE_MAINT2\5 NEPTUNE_MAINT1 (backed) Size: 407, ModTime: 7/5/2016 10:32:41 AM {text} Real: NEPTUNE_MAINT1_barnyrd\3, Virtual: NEPTUNE_MAINT\4 NEPTUNE_MAINT2 (member) Size: 411, ModTime: 8/3/2016 6:29:57 PM {text} Real: NEPTUNE_DEV2_thomas\5, Virtual: NEPTUNE_MAINT2\5 EID: 4989 on Wed May 24 9:28 AM NEPTUNE (member) Size: 412, ModTime: 8/3/2016 5:41:36 PM {text} Real: NEPTUNE_UAT_robert\1, Virtual: NEPTUNE\3 NEPTUNE_CC (backed) Size: 412, ModTime: 8/3/2016 5:41:36 PM {text} Real: NEPTUNE_UAT_robert\1, Virtual: NEPTUNE\3 ...
# TwinsExcludeFile TwinsToIgnore.txt # These evil twins will resolve when promoted to the root stream. \.\src\com\foo.java \.\src\bar.c ...