Commits

Nathan Durnan committed 41be561

Create test-script for issue.
Creates a new repository, adds a file, then removes it.
Check by updating to Rev-0 (with file) and Rev-1 (without file).
Update to Rev-1 should not trigger an error message or "open-as-CSV".

Comments (0)

Files changed (2)

 ".hgtags": {"timestamp": 1327960909.75},
 "README.md": {"timestamp": 1341533861.92},
 "Tests/BBI36_Test.bat": {"timestamp": 1341533372.44},
+"Tests/BBI38_EmptyUpdate_Test.bat": {"timestamp": 1341604677.09},
 "Tests/TimestampMod_BBI37_Test.bat": {"timestamp": 1341343207.95},
 "TimeStampMod.png": {"timestamp": 1305052883.0},
-"TimestampMod.py": {"timestamp": 1341533391.67},
+"TimestampMod.py": {"timestamp": 1341603809.98},
 "TimeStampMod.xmind": {"timestamp": 1306451621.66},
 "TimestampMod_LastRecord": {"timestamp": 0}
 }

Tests/BBI38_EmptyUpdate_Test.bat

+::------------------------------------------------------------------------------
+:: Tests for BitBucket Issue #38 - Read JSON File with no Timestamp data.
+:: The _read_TimestampJSONRecords function fails and returns an error when 
+:: updating to a revision that has no timestamp data recorded.
+::------------------------------------------------------------------------------
+:: This test-script creates a temporary test repository,
+:: creates and addes a single file, and commits the file.
+:: The file is then removed and the removal is committed.
+:: Finally, the Working directory is updated to both revisions.
+::------------------------------------------------------------------------------
+@echo off
+echo.
+echo Initializing Test Repository...
+if exist testrepo rmdir /S /Q testrepo
+mkdir testrepo
+cd testrepo
+hg init
+echo Create file (abc.txt)
+echo "abc" > abc.txt
+hg add abc.txt
+echo hg commit -m "add abc.txt"
+hg commit -m "add abc.txt"
+echo hg remove abc.txt
+hg remove abc.txt
+echo hg commit -m "remove abc.txt"
+hg commit -m "remove abc.txt"
+echo.
+echo =============================================
+echo Test #1 - Update to Rev-0 and Rev-1 normally.
+echo.
+echo ----------
+echo hg update 0
+hg update 0
+echo.
+echo.
+echo hg update 1
+hg update 1
+echo.
+echo ----------------------------------------------
+echo CHECK: no error messages should be displayed. 
+echo It should not try to open .hgtimestamp as CSV.
+echo ==============================================
+pause
+echo.
+echo.
+echo ===============================================
+echo Test #2 - Update to Rev-0 and Rev-1 w/ --debug.
+echo.
+echo ----------
+echo hg update 0 --debug
+hg update 0 --debug
+echo.
+echo.
+echo hg update 1 --debug
+hg update 1 --debug
+echo.
+echo ---------------------------------------------
+echo CHECK: no error messages should be displayed.
+echo It should not try to open .hgtimestamp as CSV.
+echo =============================================
+pause