Warning: implode() [function.implode]: Invalid arguments passed in descpage.php on line 221 - warnings

I am getting the following error:
Warning: implode() [function.implode]: Invalid arguments passed in /descpage.php on line 221
I read through the site and cannot see this covered.
Could you please have a look and see if you can see anything that would cause these issues.
This is from an old amzon store script, I don't think the programmer is updating it anymore.
Here is the full code from the page:
`
function push($myarray,$text){
$myarray[] = $text;
}
if ($Details[Address]) {
push ($descriptors, "<b>$language_text[details_text1]</b> ".($Details[Address][0]));
}
if ($Details[AmazonMaximumAge]) {
if ($Details[AmazonMaximumAge] < "24") {
$maxyears = sprintf("%.0f", $Details[AmazonMaximumAge][0]);
push ($descriptors, "<b>$language_text[details_text2]</b> $maxyears ".$language_text[miscellaneous1]);
} else{
$maxyears = sprintf("%.0f", $Details[AmazonMaximumAge][0] / 12);
push ($descriptors, "<b>$language_text[details_text2]</b> $maxyears ".$language_text[miscellaneous2]);
}
}
if ($Details[ManufacturerMaximumAge]) {
if ($Details[ManufacturerMaximumAge] < "24") {
$maxyears = sprintf("%.0f", $Details[ManufacturerMaximumAge][0]);
push ($descriptors, "<b>$language_text[details_text91]</b> $maxyears ".$language_text[miscellaneous1]);
} else{
$maxyears = sprintf("%.0f", $Details[ManufacturerMaximumAge][0] / 12);
push ($descriptors, "<b>$language_text[details_text91]</b> $maxyears ".$language_text[miscellaneous2]);
}
}
if ($Details[AmazonMinimumAge]) push ($descriptors, "<b>$language_text[details_text3]</b> ".($Details[AmazonMinimumAge][0]));
if ($Details[ApertureModes]) push ($descriptors, "<b>$language_text[details_text4]</b> ".($Details[ApertureModes][0]));
if ($Details[AspectRatio]) push ($descriptors, "<b>$language_text[details_text5]</b> ".($Details[AspectRatio][0]));
if ($Details[AudienceRating]) push ($descriptors, "<b>$language_text[details_text6]</b> ".($Details[AudienceRating][0]));
if ($Details[AudioFormat]) push ($descriptors, "<b>$language_text[details_text7]</b> ".($Details[AudioFormat][0]));
if ($Details[BackFinding]) push ($descriptors, "<b>$language_text[details_text8]</b> ".($Details[BackFinding][0]));
if ($Details[BandMaterialType]) push ($descriptors, "<b>$language_text[details_text9]</b> ".($Details[BandMaterialType][0]));
if ($Details[BatteriesIncluded]) push ($descriptors, "<b>$language_text[details_text10]</b> ".($Details[BatteriesIncluded][0]));
if ($Details[Batteries]) push ($descriptors, "<b>$language_text[details_text11]</b> ".($Details[Batteries][0]));
if ($Details[BatteryDescription]) push ($descriptors, "<b>$language_text[details_text12]</b> ".($Details[BatteryDescription][0]));
if ($Details[BatteryType]) push ($descriptors, "<b>$language_text[details_text13]</b> ".($Details[BatteryType][0]));
if ($Details[BezelMaterialType]) push ($descriptors, "<b>$language_text[details_text14]</b> ".($Details[BezelMaterialType][0]));
if ($Details[Binding]) push ($descriptors, "<b>$language_text[details_text15]</b> ".($Details[Binding][0]));
if ($Details[Brand]) push ($descriptors, "<b>$language_text[details_text16]</b> ".($Details[Brand][0]));
if ($Details[CalendarType]) push ($descriptors, "<b>$language_text[details_text17]</b> ".($Details[CalendarType][0]));
if ($Details[CameraManualFeatures]) push ($descriptors, "<b>$language_text[details_text18]</b> ".($Details[CameraManualFeatures][0]));
if ($Details[CaseDiameter]) push ($descriptors, "<b>$language_text[details_text19]</b> ".($Details[CaseDiameter][0]));
if ($Details[CaseMaterialType]) push ($descriptors, "<b>$language_text[details_text20]</b> ".($Details[CaseMaterialType][0]));
if ($Details[CaseThickness]) push ($descriptors, "<b>$language_text[details_text21]</b> ".($Details[CaseThickness][0]));
if ($Details[CaseType]) push ($descriptors, "<b>$language_text[details_text22]</b> ".($Details[CaseType][0]));
if ($Details[CDRWDescription]) push ($descriptors, "<b>$language_text[details_text23]</b> ".($Details[CDRWDescription][0]));
if ($Details[ChainType]) push ($descriptors, "<b>$language_text[details_text24]</b> ".($Details[ChainType][0]));
if ($Details[ClaspType]) push ($descriptors, "<b>$language_text[details_text25]</b> ".($Details[ClaspType][0]));
if ($Details[ClothingSize]) push ($descriptors, "<b>$language_text[details_text26]</b> ".($Details[ClothingSize][0]));
if ($Details[Color]) push ($descriptors, "<b>$language_text[details_text27]</b> ".($Details[Color][0]));
if ($Details[Compatibility]) push ($descriptors, "<b>$language_text[details_text28]</b> ".($Details[Compatibility][0]));
if ($Details[ComputerHardwareType]) push ($descriptors, "<b>$language_text[details_text29]</b> ".($Details[ComputerHardwareType][0]));
if ($Details[ComputerPlatform]) push ($descriptors, "<b>$language_text[details_text30]</b> ".($Details[ComputerPlatform][0]));
if ($Details[Connectivity]) push ($descriptors, "<b>$language_text[details_text31]</b> ".($Details[Connectivity][0]));
if ($Details[ContinuousShootingSpeed]) push ($descriptors, "<b>$language_text[details_text32]</b> ".($Details[ContinuousShootingSpeed][0]));
if ($Details[Country]) push ($descriptors, "<b>$language_text[details_text33]</b> ".($Details[Country][0]));
if ($Details[CPUManufacturer]) push ($descriptors, "<b>$language_text[details_text34]</b> ".($Details[CPUManufacturer][0]));
if ($Details[CPUSpeed]) push ($descriptors, "<b>$language_text[details_text35]</b> ".($Details[CPUSpeed][0]));
if ($Details[CPUType]) push ($descriptors, "<b>$language_text[details_text36]</b> ".($Details[CPUType][0]));
if ($Details[Cuisine]) push ($descriptors, "<b>$language_text[details_text37]</b> ".($Details[Cuisine][0]));
if ($Details[DelayBetweenShots]) push ($descriptors, "<b>$language_text[details_text38]</b> ".($Details[DelayBetweenShots][0]));
if ($Details[Department]) push ($descriptors, "<b>$language_text[details_text39]</b> ".($Details[Department][0]));
if ($Details[DeweyDecimalNumber]) push ($descriptors, "<b>$language_text[details_text40]</b> ".($Details[DeweyDecimalNumber][0]));
if ($Details[DialColor]) push ($descriptors, "<b>$language_text[details_text41]</b> ".($Details[DialColor][0]));
if ($Details[DialWindowMaterialType]) push ($descriptors, "<b>$language_text[details_text42]</b> ".($Details[DialWindowMaterialType][0]));
if ($Details[DigitalZoom]) push ($descriptors, "<b>$language_text[details_text43]</b> ".($Details[DigitalZoom][0]));
if ($Details[DisplaySize]) push ($descriptors, "<b>$language_text[details_text44]</b> ".($Details[DisplaySize][0]));
if ($Details[DVDRWDescription]) push ($descriptors, "<b>$language_text[details_text45]</b> ".($Details[DVDRWDescription][0]));
if ($Details[EAN]) push ($descriptors, "<b>$language_text[details_text46]</b> ".($Details[EAN][0]));
if ($Details[ESRBAgeRating]) push ($descriptors, "<b>$language_text[details_text47]</b> ".($Details[ESRBAgeRating][0]));
if ($Details[ExternalDisplaySupportDescription]) push ($descriptors, "<b>$language_text[details_text48]</b> ".($Details[ExternalDisplaySupportDescription][0]));
if ($Details[FabricType]) push ($descriptors, "<b>$language_text[details_text49]</b> ".($Details[FabricType][0]));
if ($Details[FaxNumber]) push ($descriptors, "<b>$language_text[details_text50]</b> ".($Details[FaxNumber][0]));
if ($Details[Feature]) push ($descriptors, "<b>$language_text[details_text51]</b> ".($Details[Feature][0]));
if ($Details[FirstIssueLeadTime]) push ($descriptors, "<b>$language_text[details_text52]</b> ".($Details[FirstIssueLeadTime][0]));
if ($Details[FloppyDiskDriveDescription]) push ($descriptors, "<b>$language_text[details_text53]</b> ".($Details[FloppyDiskDriveDescription][0]));
if ($Details[Format]) push ($descriptors, "<b>$language_text[details_text54]</b> ".($Details[Format][0]));
if ($Details[GemType]) push ($descriptors, "<b>$language_text[details_text55]</b> ".($Details[GemType][0]));
if ($Details[GraphicsCardInterface]) push ($descriptors, "<b>$language_text[details_text56]</b> ".($Details[GraphicsCardInterface][0]));
if ($Details[GraphicsDescription]) push ($descriptors, "<b>$language_text[details_text57]</b> ".($Details[GraphicsDescription][0]));
if ($Details[GraphicsMemorySize]) push ($descriptors, "<b>$language_text[details_text58]</b> ".($Details[GraphicsMemorySize][0]));
if ($Details[HardDiskCount]) push ($descriptors, "<b>$language_text[details_text59]</b> ".($Details[HardDiskCount][0]));
if ($Details[HardDiskSize]) push ($descriptors, "<b>$language_text[details_text60]</b> ".($Details[HardDiskSize][0]));
if ($Details[HasAutoFocus]) push ($descriptors, "<b>$language_text[details_text61]</b> ".($Details[HasAutoFocus][0]));
if ($Details[HasBurstMode]) push ($descriptors, "<b>$language_text[details_text62]</b> ".($Details[HasBurstMode][0]));
if ($Details[HasInCameraEditing]) push ($descriptors, "<b>$language_text[details_text63]</b> ".($Details[HasInCameraEditing][0]));
if ($Details[HasRedEyeReduction]) push ($descriptors, "<b>$language_text[details_text64]</b> ".($Details[HasRedEyeReduction][0]));
if ($Details[HasSelfTimer]) push ($descriptors, "<b>$language_text[details_text65]</b> ".($Details[HasSelfTimer][0]));
if ($Details[HasTripodMount]) push ($descriptors, "<b>$language_text[details_text66]</b> ".($Details[HasTripodMount][0]));
if ($Details[HasVideoOut]) push ($descriptors, "<b>$language_text[details_text67]</b> ".($Details[HasVideoOut][0]));
if ($Details[HasViewfinder]) push ($descriptors, "<b>$language_text[details_text68]</b> ".($Details[HasViewfinder][0]));
if ($Details[Height]) push ($descriptors, "<b>$language_text[details_text69]</b> ".($Details[Height][0]));
if ($Details[HoursOfOperation]) push ($descriptors, "<b>$language_text[details_text70]</b> ".($Details[HoursOfOperation][0]));
if ($Details[Hours]) push ($descriptors, "<b>$language_text[details_text71]</b> ".($Details[Hours][0]));
if ($Details[IncludedSoftware]) push ($descriptors, "<b>$language_text[details_text72]</b> ".($Details[IncludedSoftware][0]));
if ($Details[IncludesMp3Player]) push ($descriptors, "<b>$language_text[details_text73]</b> ".($Details[IncludesMp3Player][0]));
if ($Details[Ingredients]) push ($descriptors, "<b>$language_text[details_text74]</b> ".($Details[Ingredients][0]));
if ($Details[IsAutographed]) push ($descriptors, "<b>$language_text[details_text75]</b> ".($Details[IsAutographed][0]));
if ($Details[ISBN]) push ($descriptors, "<b>$language_text[details_text76]</b> ".($Details[ISBN][0]));
if ($Details[IsFragile]) push ($descriptors, "<b>$language_text[details_text77]</b> ".($Details[IsFragile][0]));
if ($Details[IsLabCreated]) push ($descriptors, "<b>$language_text[details_text78]</b> ".($Details[IsLabCreated][0]));
if ($Details[IsMemorabilia]) push ($descriptors, "<b>$language_text[details_text79]</b> ".($Details[IsMemorabilia][0]));
if ($Details[ISOEquivalent]) push ($descriptors, "<b>$language_text[details_text80]</b> ".($Details[ISOEquivalent][0]));
if ($Details[IssuesPerYear]) push ($descriptors, "<b>$language_text[details_text81]</b> ".($Details[IssuesPerYear][0]));
if ($Details[KeyboardDescription]) push ($descriptors, "<b>$language_text[details_text82]</b> ".($Details[KeyboardDescription][0]));
if ($Details[Label]) push ($descriptors, "<b>$language_text[details_text83]</b> ".($Details[Label][0]));
if ($Details[LegalDisclaimer]) push ($descriptors, "<b>$language_text[details_text84]</b> ".($Details[LegalDisclaimer][0]));
if ($Details[Length]) push ($descriptors, "<b>$language_text[details_text85]</b> ".($Details[Length][0]));
if ($Details[LineVoltage]) push ($descriptors, "<b>$language_text[details_text86]</b> ".($Details[LineVoltage][0]));
if ($Details[MacroFocusRange]) push ($descriptors, "<b>$language_text[details_text87]</b> ".($Details[MacroFocusRange][0]));
if ($Details[MagazineType]) push ($descriptors, "<b>$language_text[details_text88]</b> ".($Details[MagazineType][0]));
if ($Details[Manufacturer]) push ($descriptors, "<b>$language_text[details_text89]</b> ".($Details[Manufacturer][0]));
if ($Details[ManufacturerLaborWarrantyDescription]) push ($descriptors, "<b>$language_text[details_text90]</b> ".($Details[ManufacturerLaborWarrantyDescription][0]));
if ($Details[ManufacturerMinimumAge]) push ($descriptors, "<b>$language_text[details_text92]</b> ".($Details[ManufacturerMinimumAge][0]));
if ($Details[ManufacturerPartsWarrantyDescription]) push ($descriptors, "<b>$language_text[details_text93]</b> ".($Details[ManufacturerPartsWarrantyDescription][0]));
if ($Details[MaterialType]) push ($descriptors, "<b>$language_text[details_text94]</b> ".($Details[MaterialType][0]));
if ($Details[MaximumAperture]) push ($descriptors, "<b>$language_text[details_text95]</b> ".($Details[MaximumAperture][0]));
if ($Details[MaximumColorDepth]) push ($descriptors, "<b>$language_text[details_text96]</b> ".($Details[MaximumColorDepth][0]));
if ($Details[MaximumFocalLength]) push ($descriptors, "<b>$language_text[details_text97]</b> ".($Details[MaximumFocalLength][0]));
if ($Details[MaximumHighResolutionImages]) push ($descriptors, "<b>$language_text[details_text98]</b> ".($Details[MaximumHighResolutionImages][0]));
if ($Details[MaximumHorizontalResolution]) push ($descriptors, "<b>$language_text[details_text99]</b> ".($Details[MaximumHorizontalResolution][0]));
if ($Details[MaximumLowResolutionImages]) push ($descriptors, "<b>$language_text[details_text100]</b> ".($Details[MaximumLowResolutionImages][0]));
if ($Details[MaximumResolution]) push ($descriptors, "<b>$language_text[details_text101]</b> ".($Details[MaximumResolution][0]));
if ($Details[MaximumShutterSpeed]) push ($descriptors, "<b>$language_text[details_text102]</b> ".($Details[MaximumShutterSpeed][0]));
if ($Details[MaximumVerticalResolution]) push ($descriptors, "<b>$language_text[details_text103]</b> ".($Details[MaximumVerticalResolution][0]));
if ($Details[MaximumWeightRecommendation]) push ($descriptors, "<b>$language_text[details_text104]</b> ".($Details[MaximumWeightRecommendation][0]));
if ($Details[MemorySlotsAvailable]) push ($descriptors, "<b>$language_text[details_text105]</b> ".($Details[MemorySlotsAvailable][0]));
if ($Details[MetalStamp]) push ($descriptors, "<b>$language_text[details_text106]</b> ".($Details[MetalStamp][0]));
if ($Details[MetalType]) push ($descriptors, "<b>$language_text[details_text107]</b> ".($Details[MetalType][0]));
if ($Details[MiniMovieDescription]) push ($descriptors, "<b>$language_text[details_text108]</b> ".($Details[MiniMovieDescription][0]));
if ($Details[MinimumFocalLength]) push ($descriptors, "<b>$language_text[details_text109]</b> ".($Details[MinimumFocalLength][0]));
if ($Details[MinimumShutterSpeed]) push ($descriptors, "<b>$language_text[details_text110]</b> ".($Details[MinimumShutterSpeed][0]));
if ($Details[Model]) push ($descriptors, "<b>$language_text[details_text111]</b> ".($Details[Model][0]));
if ($Details[ModemDescription]) push ($descriptors, "<b>$language_text[details_text112]</b> ".($Details[ModemDescription][0]));
if ($Details[MonitorSize]) push ($descriptors, "<b>$language_text[details_text113]</b> ".($Details[MonitorSize][0]));
if ($Details[MonitorViewableDiagonalSize]) push ($descriptors, "<b>$language_text[details_text114]</b> ".($Details[MonitorViewableDiagonalSize][0]));
if ($Details[MouseDescription]) push ($descriptors, "<b>$language_text[details_text115]</b> ".($Details[MouseDescription][0]));
if ($Details[NativeResolution]) push ($descriptors, "<b>$language_text[details_text116]</b> ".($Details[NativeResolution][0]));
if ($Details[Neighborhood]) push ($descriptors, "<b>$language_text[details_text117]</b> ".($Details[Neighborhood][0]));
if ($Details[NetworkInterfaceDescription]) push ($descriptors, "<b>$language_text[details_text118]</b> ".($Details[NetworkInterfaceDescription][0]));
if ($Details[NotebookDisplayTechnology]) push ($descriptors, "<b>$language_text[details_text119]</b> ".($Details[NotebookDisplayTechnology][0]));
if ($Details[NotebookPointingDeviceDescription]) push ($descriptors, "<b>$language_text[details_text120]</b> ".($Details[NotebookPointingDeviceDescription][0]));
if ($Details[NumberOfDiscs]) push ($descriptors, "<b>$language_text[details_text121]</b> ".($Details[NumberOfDiscs][0]));
if ($Details[NumberOfIssues]) push ($descriptors, "<b>$language_text[details_text122]</b> ".($Details[NumberOfIssues][0]));
if ($Details[NumberOfItems]) push ($descriptors, "<b>$language_text[details_text123]</b> ".($Details[NumberOfItems][0]));
if ($Details[NumberOfPages]) push ($descriptors, "<b>$language_text[details_text124]</b> ".($Details[NumberOfPages][0]));
if ($Details[NumberOfPearls]) push ($descriptors, "<b>$language_text[details_text125]</b> ".($Details[NumberOfPearls][0]));
if ($Details[NumberOfRapidFireShots]) push ($descriptors, "<b>$language_text[details_text126]</b> ".($Details[NumberOfRapidFireShots][0]));
if ($Details[NumberOfStones]) push ($descriptors, "<b>$language_text[details_text127]</b> ".($Details[NumberOfStones][0]));
if ($Details[NumberOfTracks]) push ($descriptors, "<b>$language_text[details_text128]</b> ".($Details[NumberOfTracks][0]));
if ($Details[OpticalZoom]) push ($descriptors, "<b>$language_text[details_text129]</b> ".($Details[OpticalZoom][0]));
if ($Details[PearlLustre]) push ($descriptors, "<b>$language_text[details_text130]</b> ".($Details[PearlLustre][0]));
if ($Details[PearlMinimumColor]) push ($descriptors, "<b>$language_text[details_text131]</b> ".($Details[PearlMinimumColor][0]));
if ($Details[PearlShape]) push ($descriptors, "<b>$language_text[details_text132]</b> ".($Details[PearlShape][0]));
if ($Details[PearlStringingMethod]) push ($descriptors, "<b>$language_text[details_text133]</b> ".($Details[PearlStringingMethod][0]));
if ($Details[PearlSurfaceBlemishes]) push ($descriptors, "<b>$language_text[details_text134]</b> ".($Details[PearlSurfaceBlemishes][0]));
if ($Details[PearlType]) push ($descriptors, "<b>$language_text[details_text135]</b> ".($Details[PearlType][0]));
if ($Details[PearlUniformity]) push ($descriptors, "<b>$language_text[details_text136]</b> ".($Details[PearlUniformity][0]));
if ($Details[PhoneNumber]) push ($descriptors, "<b>$language_text[details_text137]</b> ".($Details[PhoneNumber][0]));
if ($Details[PhotoFlashType]) push ($descriptors, "<b>$language_text[details_text138]</b> ".($Details[PhotoFlashType][0]));
if ($Details[PictureFormat]) push ($descriptors, "<b>$language_text[details_text139]</b> ".($Details[PictureFormat][0]));
if ($Details[Platform]) push ($descriptors, "<b>$language_text[details_text140]</b> ".($Details[Platform][0]));
if ($Details[PriceRating]) push ($descriptors, "<b>$language_text[details_text141]</b> ".($Details[PriceRating][0]));
if ($Details[ProcessorCount]) push ($descriptors, "<b>$language_text[details_text142]</b> ".($Details[ProcessorCount][0]));
if ($Details[PublicationDate]) push ($descriptors, "<b>$language_text[details_text143]</b> ".($Details[PublicationDate][0]));
if ($Details[Publisher]) push ($descriptors, "<b>$language_text[details_text144]</b> ".($Details[Publisher][0]));
if ($Details[ReadingLevel]) push ($descriptors, "<b>$language_text[details_text145]</b> ".($Details[ReadingLevel][0]));
if ($Details[RegionCode]) push ($descriptors, "<b>$language_text[details_text146]</b> ".($Details[RegionCode][0]));
if ($Details[ReleaseDate]) push ($descriptors, "<b>$language_text[details_text147]</b> ".($Details[ReleaseDate][0]));
if ($Details[RemovableMemory]) push ($descriptors, "<b>$language_text[details_text148]</b> ".($Details[RemovableMemory][0]));
if ($Details[ResolutionModes]) push ($descriptors, "<b>$language_text[details_text149]</b> ".($Details[ResolutionModes][0]));
if ($Details[RingSize]) push ($descriptors, "<b>$language_text[details_text150]</b> ".($Details[RingSize][0]));
if ($Details[RunningTime]) push ($descriptors, "<b>$language_text[details_text151]</b> ".($Details[RunningTime][0]));
if ($Details[SalesRank]) push ($descriptors, "<b>$language_text[details_text194]</b> ".($Details[SalesRank][0]));
if ($Details[SecondaryCacheSize]) push ($descriptors, "<b>$language_text[details_text152]</b> ".($Details[SecondaryCacheSize][0]));
if ($Details[SettingType]) push ($descriptors, "<b>$language_text[details_text153]</b> ".($Details[SettingType][0]));
if ($Details[SizePerPearl]) push ($descriptors, "<b>$language_text[details_text154]</b> ".($Details[SizePerPearl][0]));
if ($Details[Size]) push ($descriptors, "<b>$language_text[details_text155]</b> ".($Details[Size][0]));
if ($Details[SoundCardDescription]) push ($descriptors, "<b>$language_text[details_text156]</b> ".($Details[SoundCardDescription][0]));
if ($Details[SpeakerDescription]) push ($descriptors, "<b>$language_text[details_text157]</b> ".($Details[SpeakerDescription][0]));
if ($Details[SpecialFeatures]) push ($descriptors, "<b>$language_text[details_text158]</b> ".($Details[SpecialFeatures][0]));
if ($Details[StoneClarity]) push ($descriptors, "<b>$language_text[details_text159]</b> ".($Details[StoneClarity][0]));
if ($Details[StoneColor]) push ($descriptors, "<b>$language_text[details_text160]</b> ".($Details[StoneColor][0]));
if ($Details[StoneCut]) push ($descriptors, "<b>$language_text[details_text161]</b> ".($Details[StoneCut][0]));
if ($Details[StoneShape]) push ($descriptors, "<b>$language_text[details_text162]</b> ".($Details[StoneShape][0]));
if ($Details[StoneWeight]) push ($descriptors, "<b>$language_text[details_text163]</b> ".($Details[StoneWeight][0]));
if ($Details[Studio]) push ($descriptors, "<b>$language_text[details_text164]</b> ".($Details[Studio][0]));
if ($Details[SubscriptionLength]) push ($descriptors, "<b>$language_text[details_text165]</b> ".($Details[SubscriptionLength][0]));
if ($Details[SupportedImageType]) push ($descriptors, "<b>$language_text[details_text166]</b> ".($Details[SupportedImageType][0]));
if ($Details[SystemBusSpeed]) push ($descriptors, "<b>$language_text[details_text167]</b> ".($Details[SystemBusSpeed][0]));
if ($Details[SystemMemorySizeMax]) push ($descriptors, "<b>$language_text[details_text168]</b> ".($Details[SystemMemorySizeMax][0]));
if ($Details[SystemMemorySize]) push ($descriptors, "<b>$language_text[details_text169]</b> ".($Details[SystemMemorySize][0]));
if ($Details[SystemMemoryType]) push ($descriptors, "<b>$language_text[details_text170]</b> ".($Details[SystemMemoryType][0]));
if ($Details[TheatricalReleaseDate]) push ($descriptors, "<b>$language_text[details_text171]</b> ".($Details[TheatricalReleaseDate][0]));
if ($Details[TotalDiamondWeight]) push ($descriptors, "<b>$language_text[details_text172]</b> ".($Details[TotalDiamondWeight][0]));
if ($Details[TotalExternalBaysFree]) push ($descriptors, "<b>$language_text[details_text173]</b> ".($Details[TotalExternalBaysFree][0]));
if ($Details[TotalFirewirePorts]) push ($descriptors, "<b>$language_text[details_text174]</b> ".($Details[TotalFirewirePorts][0]));
if ($Details[TotalGemWeight]) push ($descriptors, "<b>$language_text[details_text175]</b> ".($Details[TotalGemWeight][0]));
if ($Details[TotalInternalBaysFree]) push ($descriptors, "<b>$language_text[details_text176]</b> ".($Details[TotalInternalBaysFree][0]));
if ($Details[TotalMetalWeight]) push ($descriptors, "<b>$language_text[details_text177]</b> ".($Details[TotalMetalWeight][0]));
if ($Details[TotalNTSCPALPorts]) push ($descriptors, "<b>$language_text[details_text178]</b> ".($Details[TotalNTSCPALPorts][0]));
if ($Details[TotalParallelPorts]) push ($descriptors, "<b>$language_text[details_text179]</b> ".($Details[TotalParallelPorts][0]));
if ($Details[TotalPCCardSlots]) push ($descriptors, "<b>$language_text[details_text180]</b> ".($Details[TotalPCCardSlots][0]));
if ($Details[TotalPCISlotsFree]) push ($descriptors, "<b>$language_text[details_text181]</b> ".($Details[TotalPCISlotsFree][0]));
if ($Details[TotalSerialPorts]) push ($descriptors, "<b>$language_text[details_text182]</b> ".($Details[TotalSerialPorts][0]));
if ($Details[TotalSVideoOutPorts]) push ($descriptors, "<b>$language_text[details_text183]</b> ".($Details[TotalSVideoOutPorts][0]));
if ($Details[TotalUSB2Ports]) push ($descriptors, "<b>$language_text[details_text184]</b> ".($Details[TotalUSB2Ports][0]));
if ($Details[TotalUSBPorts]) push ($descriptors, "<b>$language_text[details_text185]</b> ".($Details[TotalUSBPorts][0]));
if ($Details[TotalVGAOutPorts]) push ($descriptors, "<b>$language_text[details_text186]</b> ".($Details[TotalVGAOutPorts][0]));
if ($Details[VariationDenomination]) push ($descriptors, "<b>$language_text[details_text187]</b> ".($Details[VariationDenomination][0]));
if ($Details[VariationDescription]) push ($descriptors, "<b>$language_text[details_text188]</b> ".($Details[VariationDescription][0]));
if ($Details[Warranty]) push ($descriptors, "<b>$language_text[details_text189]</b> ".($Details[Warranty][0]));
if ($Details[WatchMovementType]) push ($descriptors, "<b>$language_text[details_text190]</b> ".($Details[WatchMovementType][0]));
if ($Details[WaterResistanceDepth]) push ($descriptors, "<b>$language_text[details_text191]</b> ".($Details[WaterResistanceDepth][0]));
if ($Details[Weight]) push ($descriptors, "<b>$language_text[details_text192]</b> ".($Details[Weight][0]));
if ($Details[Width]) push ($descriptors, "<b>$language_text[details_text193]</b> ".($Details[Width][0]));
$ProductDescription = implode("<br>",$descriptors);
$tmpl->SetTemplate("productpage");
echo $tmpl->ParseTemplate();
?>`
The line mentioned in the error message is line 221 below:
$ProductDescription = implode("<br>",$descriptors);
The script seems to work fine if I hash this line out.
Can anyone see why it would do this?
Thanks in advance for your help and time.

This is "only" a warning, because the $descriptors variable was never initialized or filled with a value.
Add a $descriptors = array(); in before line 4 and everything will work as expected
function push($myarray,$text){
$myarray[] = $text;
}
if(!isset($descriptors)) {
$descriptors = array();
}
if ($Details[Address]) {

Related

Compare JSON files in powershell

################File-1.json####################
{
"aaa-prod-release-branch": {
"value": "release/S1.1-000000T01"
},
"bbb-prod-release-branch": {
"value": "release/S2.2-000000T02"
},
"ccc-prod-release-branch": {
"value": "release/S3.3-000000T03"
}
}
################File-2.json####################
{
"aaa-current-release-branch": {
"value": "release/S1.1-000000T01"
},
"bbb-current-release-branch": {
"value": "release/S2.2-000000T02"
},
"ccc-current-release-branch": {
"value": "release/S3.3-000000T044"
},
"ddd-current-release-branch": {
"value": "releases/R4.4-000000T04"
}
}
I have two JSON files with the above contents. I need to compare these two files and get differences in powershell.
Only compare branch names for repos that exists in both files and get the branch names for that respective repo.
Ex: only compare aaa, bbb and ccc branches and NOT ddd since it does not exist in both files.
For each repo (aaa, bbb, ccc) value (that exists in both files) in file-1.json I need to compare the respective repo value in File-2.json.
Example:
ccc-prod-release-branch (cc is repo name) value is different in File-2.json. In this case get both branch values and repo name in this case ccc.
release/S3.3-000000T03
release/S3.3-000000T044
Then use the above values to clone ccc repo and compare these two branches. I need a way to do this in powershell.
For ddd-current-release-branch branch since it is new I want to just run a clone and get all the commits in that branch.
How can I do this in powershell script. ?
Here's a decent starting point. I'm making some assumptions about your real naming conventions and such:
# Get your json text as an object
$json1 = Get-Content '.\file1.json' | ConvertFrom-Json
$json2 = Get-Content '.\file2.json' | ConvertFrom-Json
# Your json example comes in as a single object with each repo as a property, which isn't what you want:
aaa-prod-release-branch bbb-prod-release-branch ccc-prod-release-branch
----------------------- ----------------------- -----------------------
#{value=release/S1.1-000000T01} #{value=release/S2.2-000000T02} #{value=release/S3.3-000000T03}
So convert the awkward json to lists of powershell objects:
$prod = Foreach ($repo in $json1.psObject.Properties) {
[pscustomobject][ordered]#{
repoName = $repo.Name -replace '-prod-release-branch'
branchName = $repo.Name
releaseName = $repo.Value.Value
}}
$current = Foreach ($repo in $json2.psObject.Properties) {
[pscustomobject][ordered]#{
repoName = $repo.Name -replace '-current-release-branch'
branchName = $repo.Name
releaseName = $repo.Value.Value
}}
# Outputs:
repoName branchName releaseName
-------- ---------- -----------
aaa aaa-prod-release-branch release/S1.1-000000T01
bbb bbb-prod-release-branch release/S2.2-000000T02
ccc ccc-prod-release-branch release/S3.3-000000T03
Then it's much easier to compare them however you need:
# Example: list all differences
Compare-Object $prod $current -Property 'ReleaseName' -IncludeEqual -PassThru
repoName branchName releaseName SideIndicator
-------- ---------- ----------- -------------
aaa aaa-prod-release-branch release/S1.1-000000T01 ==
bbb bbb-prod-release-branch release/S2.2-000000T02 ==
ccc ccc-current-release-branch release/S3.3-000000T044 =>
ccc ccc-prod-release-branch release/S3.3-000000T03 <=
ddd ddd-current-release-branch releases/R4.4-000000T04 =>
# Example: repos that need full clone
$ToClone = $current | Where { $_.repoName -NotIn $prod.repoName }

Enable/Disable Offline File Sync

Here is the script from the site I found and I wanted to know if there is a way to improve it as when it's running I get this:
Configure Offline files on localhost …
Disable offline files failed with
Configure Offline files on localhost …
Enable offline files failed with
reboot required
I mean it does what it suppose to do just that message is annoying
This is as it was originally typed:
param($computer=”localhost”, $a, $help)
function funline ($strIN)
{
$num = $strIN.length
for($i=1 ; $i -le $num ; $i++)
{ $funline += “=” }
Write-Host -ForegroundColor yellow $strIN
Write-Host -ForegroundColor darkYellow $funline
}
function funHelp()
{
$helpText=#”
DESCRIPTION:
NAME: EnableDisableOffLineFiles.ps1
Enables or disables offline files on a local or remote machine.
A reboot of the machine MAY be required. This information will
be displayed in the status message once the script is run.
PARAMETERS:
-computer Specifies name of the computer upon which to run the script
-a(ction) < e(nable), d(isable) >
-help prints help file
SYNTAX:
EnableDisableOffLineFiles.ps1 -computer MunichServer -a e
Enables offline files on a computer named MunichServer
EnableDisableOffLineFiles.ps1 -a d
Disables offline files on local computer
EnableDisableOffLineFiles.ps1 -help ?
Displays the help topic for the script
“#
$helpText
exit
}
function funtranslatemethod($a)
{
switch($a)
{
“e” { $global:m = $true
$global:msg = “Enable offline files”
}
“d” {
$global:m = $false
$global:msg = “Disable offline files”
}
default{
$global:msg = “$a is not an allowed response`n”
}
}
}
if($help){ funline(“Obtaining help …”) ; funhelp }
if(!$a)
{
$(throw “You must supply an action. try this:
EnableDIsableOfflineFiles.ps1 -help ?”)
}
$global:msg =$global:m = $null
funtranslatemethod($a)
$objWMI = [wmiclass]”\\$computer\root\cimv2:win32_offlinefilescache”
funline(“Configure Offline files on $computer …”)
$rtn = $objwmi.enable($m)
if($rtn.returnvalue -eq 0)
{
Write-Host -ForegroundColor green “$msg succeeded”
}
ELSE
{
Write-Host -ForegroundColor red “$msg failed with $($rtn.returnvalue) ”
}
if($rtn.rebootrequired)
{ Write-Host -ForegroundColor cyan “reboot required” }
Here is what I did
Function EnableDisable-OfflineFiles{
param($computer=”localhost”, $a, $help)
<#
DESCRIPTION:
NAME: EnableDisableOffLineFiles.ps1
Enables or disables offline files on a local or remote machine.
A reboot of the machine MAY be required. This information will
be displayed in the status message once the script is run.
PARAMETERS:
-computer Specifies name of the computer upon which to run the script
-a(ction) < e(nable), d(isable) >
-help prints help file
SYNTAX:
EnableDisableOffLineFiles.ps1 -computer MunichServer -a e
Enables offline files on a computer named MunichServer
EnableDisableOffLineFiles.ps1 -a d
Disables offline files on local computer
EnableDisableOffLineFiles.ps1 -help ?
Displays the help topic for the script
“#
$helpText
#>
function funline ($strIN)
{
$num = $strIN.length
for($i=1 ; $i -le $num ; $i++)
{ $funline += “=” }
Write-Host -ForegroundColor yellow $strIN
Write-Host -ForegroundColor darkYellow $funline
}
function funHelp()
{
$helpText=#”
DESCRIPTION:
NAME: EnableDisableOffLineFiles.ps1
Enables or disables offline files on a local or remote machine.
A reboot of the machine MAY be required. This information will
be displayed in the status message once the script is run.
PARAMETERS:
-computer Specifies name of the computer upon which to run the script
-a(ction) < e(nable), d(isable) >
-help prints help file
SYNTAX:
EnableDisableOffLineFiles.ps1 -computer MunichServer -a e
Enables offline files on a computer named MunichServer
EnableDisableOffLineFiles.ps1 -a d
Disables offline files on local computer
EnableDisableOffLineFiles.ps1 -help ?
Displays the help topic for the script
“#
$helpText
}
function funtranslatemethod($a)
{
switch($a)
{
“e” { $global:m = $true
$global:msg = “Enable offline files”
}
“d” {
$global:m = $false
$global:msg = “Disable offline files”
}
default{
$global:msg = “$a is not an allowed response`n”
}
}
}
if($help){ funline(“Obtaining help …”) ; funhelp }
if(!$a)
{
$(throw “You must supply an action. try this:
EnableDIsableOfflineFiles.ps1 -help ?”)
}
$global:msg =$global:m = $null
funtranslatemethod($a)
$objWMI = Get-WmiObject -Class Win32_OfflineFilesCache -Computer $computer
funline(“Configure Offline files on $computer …”)
$rtn = $objwmi.Enabled($m)
if($rtn.returnvalue -eq 0)
{
Write-Host -ForegroundColor green “$msg succeeded”
}
ELSE
{
Write-Host -ForegroundColor red “$msg failed with $($rtn.returnvalue) ”
}
if($rtn.rebootrequired)
{ Write-Host -ForegroundColor cyan “reboot required” }
}
I get this error when I run this function
Method invocation failed because [System.Management.ManagementObject]
does not contain a method named 'Enabled'.
$rtn = $objwmi.Enabled($m)
+ CategoryInfo : InvalidOperation: (Enabled:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound
This looks like the same question I saw on reddit earlier this evening. I answered it over there but I'll give a brief answer here as well.
The error is that you're calling the method Enabled. Enabled is the name of a property of the Win32_OfflineFilesCache CIM class, indicating the current state. The method itself is named Enable - present tense - to set the state. The naming is pretty ambiguous, especially because it's also used to disable offline files.
To see the names of the methods and properties of a CIM class, use the Get-CimClass cmdlet.
Get-CimClass -ClassName Win32_OfflineFilesCache | Select-Object -ExpandProperty CimClassMethods
Name ReturnType Parameters Qualifiers
---- ---------- ---------- ----------
Enable UInt32 {Enable, RebootRequired} {implemented, static}
RenameItem UInt32 {NewPath, OriginalPath, ReplaceIfExists} {implemented, static}
RenameItemEx UInt32 {NewPath, OriginalPath, ReplaceIfExists} {implemented, static}
Synchronize UInt32 {Flags, Paths} {implemented, static}
Pin UInt32 {Deep, Flags, Paths} {implemented, static}
Unpin UInt32 {Deep, Flags, Paths} {implemented, static}
DeleteItems UInt32 {Flags, Paths} {implemented, static}
Encrypt UInt32 {Encrypt, Flags} {implemented, static}
SuspendRoot UInt32 {Path, Suspend} {implemented, static}
TransitionOffline UInt32 {Flags, Force, Path, OpenFiles} {implemented, static}
TransitionOnline UInt32 {Flags, Path} {implemented, static}
The line that is failing is:
$rtn = $objwmi.Enabled($m)
You have a capital 'E' on Enabled.
What happens when you make that lowercase like in the original script.

PowerShell to MySQL : SQL statement after the COMMIT is also committed

I am inserting values from PowerShell into MySQL table. I have 2 Insert statements (insertQuery1,insertQuery2) in transaction.
There is COMMIT after insertQuery1 so changes in query_1 is committed but there is no is COMMIT after insertQuery2 yet changes in query_2 are also committed. Can someone please let me know why are changes in query_2 are also committed even when there is no COMMIT statement after it.
If I do not use COMMIT both the queries are not committed.
$oConnection = New-Object MySql.Data.MySqlClient.MySqlConnection($sConnectionString)
try
{
$oConnection.Open()
$oMYSQLCommand = New-Object MySql.Data.MySqlClient.MySqlCommand
$oMYSQLTransaction = $oConnection.BeginTransaction();
$oMYSQLCommand.Connection=$oConnection
$oMYSQLCommand.Transaction = $oMYSQLTransaction;
$insertQuery1 ='INSERT into `temp_schema`.`temp_table` (`temp_col`) VALUES('+'"'+$temp_val1+'"' +')'
$oMYSQLCommand.CommandText=$insertQuery1
$iRowsAffected=$oMYSQLCommand.ExecuteNonQuery()
$oMYSQLTransaction.Commit();
Start-Sleep -Seconds 10
$insertQuery2 ='INSERT into `temp_schema`.`temp_table` (`temp_col`) VALUES('+'"'+$temp_val2+'"' +')'
$oMYSQLCommand.CommandText=$insertQuery2
$iRowsAffected=$oMYSQLCommand.ExecuteNonQuery()
}
catch{
write-warning ("Error: "+$Error[0].ToString())
}
finally{
$oMySqlCommand.Connection.Close()
}
Ok, I realized the Transaction is completed after COMMIT and as insertQuery2 is not part of any Transaction it is auto-commited.

How to look at an existing merge-commit in a 3 way diff tool

I am interested in looking at this commit:
[Sep-26 16:14]$ hg log --rev 4b47cc6d212d
changeset: 186413:4b47cc6d212d
parent: 186412:108068f9c1c6
parent: 185155:3452a331b240
summary: merge master to jakeFeatureBranch
As you can see this is a merge. I would like to open this merge in my 3-way-diff tool to see how conflicts were resolved. How can I do this?
I tried running hg bcompare -c 4b47cc6d212d but my difftool is just launched with two files.
When I am doing a merge my diff tool will open in 3 way merge mode.
Slightly more robust version:
#!/bin/bash
set -eu
MERGE_REV=$1
FILE_NAME=$2
echo "Replaying merge ${MERGE_REV} for file ${FILE_NAME}"
hg log --rev "${MERGE_REV}"
echo "Extracting key revisions"
PARENT_REV_1=$(HGPLAIN= hg log --rev "${MERGE_REV}"^1 --template '{node|short}')
PARENT_REV_2=$(HGPLAIN= hg log --rev "${MERGE_REV}"^2 --template '{node|short}')
if [ -z "${PARENT_REV_2}" ];
then
echo "Abort: ${MERGE_REV} is not a merge revision"
exit 1
fi
BASE_REV=$(HGPLAIN= hg log -r "max(ancestor("${PARENT_REV_1}", "${PARENT_REV_2}"))" --template '{node|short}\n')
echo "Merge Commit: ${MERGE_REV}"
echo "Parent 1: ${PARENT_REV_1}"
echo "Parent 2: ${PARENT_REV_2}"
echo "Base: ${BASE_REV}"
TMP_DIR=$(mktemp --directory --tmpdir replaymerge.XXXX)
echo "writing to ${TMP_DIR}"
MERGE_RESULT="${TMP_DIR}"/merge-result
PARENT_1="${TMP_DIR}"/parent-1
PARENT_2="${TMP_DIR}"/parent-2
BASE_FILE="${TMP_DIR}"/base-file
hg cat --rev "${MERGE_REV}" "${FILE_NAME}" > "${MERGE_RESULT}"
hg cat --rev "${PARENT_REV_1}" "${FILE_NAME}" > "${PARENT_1}"
hg cat --rev "${PARENT_REV_2}" "${FILE_NAME}" > "${PARENT_2}"
hg cat --rev "${BASE_REV}" "${FILE_NAME}" > "${BASE_FILE}"
echo "Retry the 3-way merge"
# Replace with your diff tool here.
# WARNING: some diff tools accept a different ordering for the file
# panes, and will not put the contents of your 4th file into their 4th
# window. They only use that for saving, not reading.
bcompare "${PARENT_1}" "${PARENT_2}" "${BASE_FILE}" "${MERGE_RESULT}" || true
rm -rf "${TMP_DIR}"
extracts the revisions without using grep/sed/head/tail (uses native mercurial templating)
deletes the temporary files
detects non-merge revisions
This works.
#!/bin/bash
set -e
mergeCommit=$1
file=$2
echo "Replaying this merge"
hg log --rev $mergeCommit
echo "Extracting key revisions and writting to /tmp"
parent1=$(hg log --rev $mergeCommit | grep 'parent' | head -n1 | sed 's_.*:__')
parent2=$(hg log --rev $mergeCommit | grep 'parent' | tail -n1 | sed 's_.*:__')
base=$(hg log -r "max(ancestor($parent1, $parent2))" | grep 'changeset' | tail -n1 | sed 's_.*:__')
echo "Merge Commit: $mergeCommit"
echo "Parent 1: $parent1"
echo "Parent 2: $parent2"
echo "Base: $base"
actualMergeResult=/tmp/actualMerge
correctMergeResult=/tmp/correctMerge
parent1File=/tmp/parent1
parent2File=/tmp/parent2
baseFile=/tmp/base
hg cat --rev "$mergeCommit" "$file" > "$actualMergeResult"
hg cat --rev "$parent1" "$file" > "$parent1File"
hg cat --rev "$parent2" "$file" > "$parent2File"
hg cat --rev "$base" "$file" > "$baseFile"
echo "Retry the 3-way merge"
# Replace with your diff tool here. WARNING: some diff tools will
# not put the contents of your 4th file into their 4th window. They
# only use that for saving, not reading.
bcompare $parent1File $parent2File $baseFile $correctMerge || true

Can you do hg clone without getting default path?

BRIEF:
hg clone creates path "default" in /.hg/hgrc, set to where you cloned from.
Q: is it possible to disable this automatically?
DETAIL:
This is already partially answered.
In Can you prevent default-push, but allow pull? we see how to set default-push, in some hgrc file such as /.hg/hgrc, or (my preference), in ~/.hgrc
In Is hg clone equivalent to hg (init→pull)
Tim Henigan says that hg clone = init; pull; hg update default; setting up default path in /.hg/hgrc.
Although elsewhere we see that this is not quite true. hg clone may differ, e.g., in that it does hard link sharing. Lacking an official statement of equivalence...
Now, disabling default-push helps a lot.
But... I have fallen into the habit of doing "hg push default". Which somewhat defaets the p;urpose.
By the way: reason I am doing this, wanting to disable the default: workflow that goes master->workspace->staging_area->master. I do many clones of the master. Modifying /.hg/hgrc to edit [path] default each time I do a cline is a pain. Doing "hg push" or "hg push default" in any of the workspaces can be bad. Instead I need to push to the staging area, ad only from the staging area am I allowed to push to the master.
(I have tried master<->staging_area<->workspace, i.e. always cloning from the sdtaging area. But I found this confusing. Plus, the part that I haven't said yet: my project makes me delete or collapse history, which adds an additional level of confusion and error-prone-ness.)
Here's the post-clone hook I came up with:
[hooks]
post-clone = perl ~/bin/delete-default-from-.hgrc "$HG_PATS"
and the perl script is below.
I'd still like to find a one-liner.
#!/usr/local/bin/perl
use strict;
print "editing <repo>/.hg/hgrc to to remove [paths] / default";
# Hand tested
# cd ~/mips/uarch-perf-sim/psim+stuff/f; rm -rf k; hg clone ../m k
# cd ~/mips/uarch-perf-sim/psim+stuff/f; rm -rf k; hg clone ../m
my $debug = 0;
my $hg_pats = $ARGV[0];
die "Usage: delete-default-from-.hgrc HG_PATS (from post-clone hook)\n" if !exists $ARGV[0] || exists $ARGV[2];
# expect HG_PATS from post-clone hook
#['../m']
#['../m', 'target']"
#['../m', '../target']"
my $from;
my $target;
if( $hg_pats =~ m/^\['([^']+)'\]$/ ) {
$from = $1;
$target = $from;
# delete paths if target implicit
$target =~ s{.*/}{};
print "from-only: $target\n" if $debug;
} elsif( $hg_pats =~ m/^\['([^']+)',\s+'([^']+)'\]$/ ) {
$from = $1;
$target = $2;
# do NOT delete paths if target explicit
print "from to: $target\n" if $debug;
} else {
die "expected HG_PATS, got: $hg_pats\n";
}
die "clone target not found: $target\n" if ! -d $target;
my $hgrc = "$target/.hg/hgrc";
die "clone target/.hg/hgrc not found: $hgrc\n" if ! -r "$hgrc";
open( my $in, "<$hgrc" ) || die "could not open $hgrc to read (edit)\n";
unlink "$hgrc.tmp";
open( my $out, ">$hgrc.tmp" ) || die "could not open $hgrc.tmp to write\n";
my $section = '';
my $paths_found;
my $paths_default_found;
while( my $line = <$in> ) {
chomp($line);
print "line = $line\n" if $debug;
if( $line =~ m/^\[paths\]/ ) {
$section = "[paths]";
$paths_found++;
}
elsif( $line =~ m/^\[/ ) {
$section = $line;
}
elsif( ($section eq "[paths]") and ($line =~ m/^\s*default\s*=/) ) {
$line =~ s/default/default-cloned-from/;
$paths_default_found++;
}
print $out $line."\n";
}
die "[paths] section not found in $hgrc" if ! $paths_found;
die "[paths] / default not found in $hgrc" if ! $paths_default_found;
system("echo '<diff edited $hgrc>';diff -U10 $hgrc $hgrc.tmp; echo '</diff>'");
unlink "$hgrc.orig";
die "could not unlink older $hgrc.orig" if -e "$hgrc.orig";
rename "$hgrc","$hgrc.orig" || die "could not rename $hgrc to $hgrc.orig";
rename "$hgrc.tmp","$hgrc" || die "could not rename $hgrc.tmp to $hgrc";
system("echo '$hgrc:';cat $hgrc");
exit(0);