|
|
|
Posted
over 3 years
ago
by
nore...@blogger.com (Alex Yakunin)
Since it is possible to push your own code modifications to DataObjects.Net, it's right time to give few more links: General article: Coding Guidelines. Unfortunately, many topics there aren't written yet, so below are the most complete and
... [More]
important ones. File Naming Rules - quite short ;)
C# Coding Style String Resource Naming Conventions C# Coding Guidelines C# Unit Testing Guidelines
SQL Coding Style JavaScript Coding Style - just to show it exists as well ;)
Please read at least the following documents before starting to modify our code:
File Naming Rules
C# Coding Style String Resource Naming Conventions [Less]
|
|
Posted
over 3 years
ago
by
nore...@blogger.com (Alex Yakunin)
You must complete 2 steps: 1. Request Project Committer permission by sending us an e-mail from your Google account. 2. Right-click on the folder where you repository clone is stored and select "TortoiseHg" - "Repository
... [More]
Settings". Set the specified options there as it is show on screenshots below.
Set your own user name. Preferable one is "Name Surname", although nicknames are ok as well.
Specify your Google account name and password by double-clicking on "default" alias. You can also select "Fetch after Pull" there - normally this is desirable option.
The following dialog will appear after double-clicking on "default" alias. Account name and password must be specified there.
After these actions your hgrc file must look like:
[web] name = DataObjects.Net description = DataObjects.Net project repository contact = info@x-tensive.com allow_archive = bz2 allow_push = * push_ssl = False encoding = UTF-8
[paths] default = https://alex.yakunin%40gmail.com:password@dataobjectsdotnet.googlecode.com/hg/
[tortoisehg] postpull = fetch
Steps for editing its [web] sections aren't described here, but this section is necessary only if you are going to expose your repository via web (e.g. using hg serve).
So another way to configure your repository for pushes is to edit your hgrc file - e.g. using Notepad. The file is located right in <YourRepositoryRoot>\.hg folder.
Note: as I wrote earlier, the revisions you see now are produced by one-way sync from our Subversion repository. So if you’ll push your own commits right now, they will be branched aside from the primary branch we update, and it won’t be possible to merge them into the primary branch until we completely migrated to Mercurial. So if you will modify the code, please do not push the changes at all until migration at our side is completed. This will take just about a week.
Btw, Mercurial allows you to merge your changes locally and push them later – it is truly decentralized system. [Less]
|
|
Posted
over 3 years
ago
by
nore...@blogger.com (Alex Yakunin)
In short, DataObjects.Net is now almost fully compatible with 64-bit Windows. "Almost" - because currently there is no 64-bit Oracle provider for SQL DOM, so you can't use DataObjects.Net with Oracle on 64-bit Windows for now. Of course
... [More]
, this implies its installers (they were updated today) and all the scripts there like Install.bat / Build.bat now properly work in 64-bit environment. [Less]
|
|
Posted
over 3 years
ago
by
nore...@blogger.com (Alex Yakunin)
I can announce NerdDinner port for DataObjects.Net (ASP.NET MVC application) is already available in our source code repository, so you can try it right now. Prerequisites: IIS 6.0 or higher SQL Server 2005 or
... [More]
higher DataObjects.Net v4.1 RC or higher ASP.NET MVC 1. You can find the distributive in "Install" folder. DO40-Test database on SQL Server.
To download, build, install and run it:
Complete all the steps described here Open command prompt in "\Sandbox\AspNetMvcSample" folder and type: Build.bat Install/Install.bat Open.bat
Expected result is show on this screenshot: [Less]
|
|
Posted
over 3 years
ago
by
nore...@blogger.com (Alex Yakunin)
Google Code provides few really convenient tools:
Online source code browser. See e.g. our HelloWorld sample code. Note that you can link to individual lines of code. Project updates page showing all the commits, changes made in issue tracker and so on. There is RSS/Atom subscription.
|
|
Posted
over 3 years
ago
by
nore...@blogger.com (Alex Yakunin)
This really easy: Install TortoiseHg - the Mercurial client. Create folder named "DataObjects.Net" at any place you like. Folder name is also upon your wish. Clone the repository: right-click on it and select "TortoiseHg" - "Clone a
... [More]
Repository", set Source Path to https://dataobjectsdotnet.googlecode.com/hg/ and click "Clone". Wait while TortoiseHg downloads the repository. Its size is about 300Mb, so it can be a long process, although a lot depends on your connection speed. I just tested this - in my case it took about 12 minutes. Note that you'll have its full replica containing complete change history on completion of this process.
An alternative to the previous step: open command prompt in "DataObjects.Net" folder and type: hg clone https://dataobjectsdotnet.googlecode.com/hg/ . Open command prompt in "DataObjects.Net" folder and type: Install\InstallAll.bat -b - to get the project built (in Release configuration) and installed. This command will install samples, project templates and everything else. See this post for detailed description of actions performed by Install.bat.
That's all. The copy you'll have will be almost identical to the one shipped via installer, the only difference is absence of .HxS and .Chm help files. Currently you can take them from installer, but shortly we'll be publishing them separately. They must be copied to "Help" folder - if this is done, InstallAll.bat will integrate them into Visual Studio .NET help collection. Or you can simply run Install.bat from Help folder.
To remove everything, run Install\Uninstall.bat and remove "DataObjects.Net" folder. [Less]
|
|
Posted
over 3 years
ago
by
Dmitri Maximov
|
|
Posted
over 3 years
ago
by
nore...@blogger.com (Alex Yakunin)
If repository is complex, forget about "hg convert hg transplant" way: Likely, hg convert convert everything. See this post for details. Hg transplant (as well as hg export hg import) will fail on any of cases listed
... [More]
below.
1. Mercurial on Windows does not "understand" renames changing only case of file or folder name.
To handle this, I wrote a sequence of commands renaming such "manually".
2. Patches produced by hg export --git aren't always properly processed by hg import. As far as I can judge, import fails if such a patch contains file rename its subsequent modification. So I used export without --git option to properly migrate such patches.
It's reasonable to ask why I didn't use this way for any patch. Well, it does not work at all if there are binary modifications.
So if I'd have binary modifications mixed up into such patches, this approach won't work.
3. If you're going to push produced repository to Google Code, it won't accept large binary files. By my impression it does not accept files larger than 100 MB.
In our case there is just a single file of such size: AdventureWorks.vdb3, which is used in VistaDB provider tests. So my conversion script was simply truncating this file to few bytes in any revision where it was added or moved.
4. Moreover, it seems Google Code simply rejects any sequence of patches that is larger than 100 MB.
So implemented a simple script pushing the changes in bulks of any desirable size.
That's all. So there are issues, but they can be handled. The scripts I used to convert our repository are provided below.
Clone-DataObjects.Net-GoogleCode.bat:
hg clone https://login%@gmail.com:googleCodePassword@dataobjectsdotnet.googlecode.com/hg/ DataObjects.Net
Convert-DataObjects.Net.bat:
@echo off set TargetRepo=DataObjects.Net set Part1Repo=Xtensive1 set Part2Repo=Xtensive2 set OldAdventureWorksVdb3=Xtensive.Sql\Xtensive.Sql.Dom.Tests\VistaDb\AdventureWorks.vdb3 set AdventureWorksVdb3=Xtensive.Sql\Xtensive.Sql.Tests\VistaDb\AdventureWorks.vdb3
rmdir /S /Q %TargetRepo% >nul 2>nul rmdir /S /Q Diffs >nul 2>nul mkdir Diffs >nul 2>nul
:ConvertPart1 echo Converting part 1: rmdir /S /Q %Part1Repo% hg convert "D:\Users\Common\Repositories\Xtensive" %Part1Repo% --authors Authors.txt --filemap Filemap-Xtensive.txt --config convert.svn.startrev=8156 --rev 11539 echo Done.
:ConvertPart2 echo Converting part 2: rmdir /S /Q %Part2Repo% hg convert "D:\Users\Common\Repositories\Xtensive" %Part2Repo% --authors Authors.txt --filemap Filemap-Xtensive.txt --branchmap Branchmap-Xtensive.txt --config convert.svn.trunk=Trunk --config convert.svn.branches=Empty --config convert.svn.tags=Tags echo Done.
:MigratePart1 echo Migrating part 1: if not exist "%TargetRepo%" call "Clone-%TargetRepo%-GoogleCode.bat" for /L %%i IN (0,1,2580) do ( if "%%i"=="0" ( if not exist "Diffs\%Part1Repo%-%%i.done" ( call :MigrateGit %Part1Repo% %%i --no-commit pushd %TargetRepo% call :Truncate "%OldAdventureWorksVdb3%" hg add "%OldAdventureWorksVdb3%" if not "%ERRORLEVEL%"=="0" exit hg commit -m "Initial import." if not "%ERRORLEVEL%"=="0" exit popd ) ) else if "%%i"=="656" ( call :MigrateNoGit %Part1Repo% %%i ) else if "%%i"=="767" ( call :MigrateNoGit %Part1Repo% %%i ) else if "%%i"=="768" ( call :MigrateNoGit %Part1Repo% %%i ) else if "%%i"=="835" ( if not exist "Diffs\%Part1Repo%-%%i.done" ( call :SafeRename "Xtensive.Storage.Samples/Xtensive.Storage.Samples.WPF" "Xtensive.Storage.Samples/Xtensive.Storage.Samples.Wpf" echo Migrated. > "Diffs\%Part1Repo%-%%i.done" ) ) else if "%%i"=="836" ( if not exist "Diffs\%Part1Repo%-%%i.done" ( call :SafeRename "Xtensive.Storage.Samples/Xtensive.Storage.Samples.Wpf/Xtensive.Storage.Samples.WPF.csproj" "Xtensive.Storage.Samples/Xtensive.Storage.Samples.Wpf/Xtensive.Storage.Samples.Wpf.csproj" echo Migrated. > "Diffs\%Part1Repo%-%%i.done" ) ) else if "%%i"=="1085" ( if not exist "Diffs\%Part1Repo%-%%i.done" ( call :SafeRename "Release.ProjectTemplate/DataObjects.Net 4.0 project/DataObjects.Net 4.0 project.vstemplate" "Release.ProjectTemplate/DataObjects.Net 4.0 project/DataObjects.Net 4.0 Project.vstemplate" echo Migrated. > "Diffs\%Part1Repo%-%%i.done" ) ) else call :MigrateGit %Part1Repo% %%i ) echo Done.
:MigratePart2 echo Migrating part 2: for /L %%i IN (1,1,5000) do ( if "%%i"=="4" ( echo Skipping revision %%i - it moves existing files into Trunk from the outside, but they're already there in %Part1Repo% ) else if "%%i"=="181" ( if not exist "Diffs\%Part2Repo%-%%i.done" ( call :SafeRename "Common\Config.nikolaev.targets" "Common\Config.Nikolaev.targets" echo Migrated. > "Diffs\%Part2Repo%-%%i.done" ) ) else if "%%i"=="246" ( if not exist "Diffs\%Part2Repo%-%%i.done" ( call :MigrateGit %Part2Repo% %%i --no-commit pushd %TargetRepo% call :Truncate "ventureWorksVdb3%" rem hg add "ventureWorksVdb3%" rem if not "%ERRORLEVEL%"=="0" exit hg commit -m "Merged changes from SqlDom branch" rem if not "%ERRORLEVEL%"=="0" exit popd ) ) else call :MigrateGit %Part2Repo% %%i ) echo Done. goto :End
:MigrateGit set GitOption=--git goto :Migrate
:MigrateNoGit set GitOption= goto :Migrate
:Migrate echo Migrating %2 revision: set done=..\Diffs\%1-%2.done if exist "%1\%done%" ( echo Skipping %2: already migrated. goto :End ) set diff=..\Diffs\%1-%2.diff pushd %1 if not exist "%diff%" ( echo Exporting %2... hg export %2:%2 -o "%diff%" %GitOption% if not "%ERRORLEVEL%"=="0" exit ) call :DetectCommentAndTag %2 popd pushd %TargetRepo% echo Importing %2... hg patch "%diff%" %Comment% --import-branch %3 %4 %5 %6 %7 %8 %9 if not "%ERRORLEVEL%"=="0" exit if not "%Tag%"=="" ( echo Tagging %2 as %Tag% hg up tip hg tag -f -m "Tag created: %Tag%" "%Tag%" if not "%ERRORLEVEL%"=="0" exit ) echo Migrated > %done% popd echo Done. goto :End
:SafeRename pushd %TargetRepo% echo Renaming: '%~1' to '%~2'. hg up if not "%ERRORLEVEL%"=="0" exit hg rename "%~1" "%~1.tmp" if not "%ERRORLEVEL%"=="0" exit rmdir /S /Q "%~1" >nul 2>nul hg rename "%~1.tmp" "%~2" if not "%ERRORLEVEL%"=="0" exit rmdir /S /Q "%~1.tmp" >nul 2>nul hg commit -m "Safe rename: '%~1' to '%~2'" if not "%ERRORLEVEL%"=="0" exit hg up if not "%ERRORLEVEL%"=="0" exit popd goto :End
:Truncate echo Truncating %1... echo Truncated. > %1 goto :End
:DetectCommentAndTag set Comment=-m "No comment." set Tag= for /F "tokens=1,2* delims=: eol=" %%i in ('hg log -r %1') do ( if "%%i"=="summary" call :ResetComment if "%%i"=="tag" call :SetTag "%%j" ) goto :End
:ResetComment set Comment= goto :End
:SetTag set Tag=%~1 set Tag=%Tag:~9% goto :End
:End
Push-DataObjects.Net.bat:
@echo off set PushBatchSize=100
pushd DataObjects.Net for /L %%i IN (0,%PushBatchSize%,5000) do ( Echo Pushing changes up to revision %%i... hg push -r %%i ) popd [Less]
|
|
Posted
over 3 years
ago
by
nore...@blogger.com (Alex Yakunin)
This great day has come: DataObjects.Net is now true open source product. From this day you can find its complete source code at Google Code. Check out: List of project updates; Online source code browser. I must say it
... [More]
was really tricky to convert big Subversion repository to Hg. Tomorrow I'll describe all the issues I faced, but for now it's enough to say you'll see all the project updates at Google Code ~ on weekly basis.
Currently we aren't switched from our internal Subversion repository to Mercurial. We'll use Subversion internally until all the stuff sensitive to repository type (e.g. installer builder and build servers) is migrated to Mercurial. This process will take about one week (the speed here isn't really important). After this moment Subversion will die completely.
We run our own Mercurial repository as well - now it just pulls out the updates from Subversion and periodically pushing them to Google Code. But in near future all our developers will simply sync with it.
Subversion is almost dead. Long live Mercurial! [Less]
|
|
Posted
over 3 years
ago
by
Dmitri Maximov
|