Custom dev, source control, changesets - best practices?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I'm still a bit confused as to how to best use the source control / codeplex changesets:  I'd like to make custom changes side by side with ongoing team development, merge in bug fixes, but not merge in next version features, and yet when new version comes out, merge in my custom changes to that new version.
How are others doing this?  Any thoughts?  Advice?

TIA
12 years ago
New York wrote:
I'm still a bit confused as to how to best use the source control / codeplex changesets:  I'd like to make custom changes side by side with ongoing team development, merge in bug fixes, but not merge in next version features, and yet when new version comes out, merge in my custom changes to that new version.
How are others doing this?  Any thoughts?  Advice?

TIA


You should use Mercurial DVCS (hg) and VisualHg. Clone a copy of the codeplex repository write code and commit it back to your clone. You can then make pull requests of the codeplex repository when changes are released and you want them. To make changes in the system until you are forced to do something different you should try and make changes in one of the following methods:

1. A plugin! You can override services, create data entities, create views, and everything else within a plugin.
2. Create a separate library with all of your custom entities and reference it in the website.

If you cannot do one of those then modify the nopCommerce code directly. Just beware that the two methods above will limit the amount of conflicts and headaches that can arise out of developing in parallel on an open source rapid development system. Good luck!
12 years ago
Skyler is absolutely right
12 years ago
skyler.severns wrote:

You should use Mercurial DVCS (hg) and VisualHg. Clone a copy of the codeplex repository write code and commit it back to your clone. You can then make pull requests of the codeplex repository when changes are released and you want them.

I started using TortoiseHg.  Haven't yet installed VisualHg.  I cloned Nop to my local drive - one repository; Are you saying I need two clones?  I don't think I follow your work flow.

skyler.severns wrote:

To make changes in the system until you are forced to do something different you should try and make changes in one of the following methods:

1. A plugin! You can override services, create data entities, create views, and everything else within a plugin.
2. Create a separate library with all of your custom entities and reference it in the website.


I do plan on putting as much as I can into plugins  ( I see you've blogged a bit about plugins, and it's on my to-read list :)
I do think, though, that there are certainly times that will require changes to existing Views to get the right look and feel.  Maybe ability to "create views" could help with that.
12 years ago
New York wrote:

You should use Mercurial DVCS (hg) and VisualHg. Clone a copy of the codeplex repository write code and commit it back to your clone. You can then make pull requests of the codeplex repository when changes are released and you want them.

I started using TortoiseHg.  Haven't yet installed VisualHg.  I cloned Nop to my local drive - one repository; Are you saying I need two clones?  I don't think I follow your work flow.


To make changes in the system until you are forced to do something different you should try and make changes in one of the following methods:

1. A plugin! You can override services, create data entities, create views, and everything else within a plugin.
2. Create a separate library with all of your custom entities and reference it in the website.


I do plan on putting as much as I can into plugins  ( I see you've blogged a bit about plugins, and it's on my to-read list :)
I do think, though, that there are certainly times that will require changes to existing Views to get the right look and feel.  Maybe ability to "create views" could help with that.



Sorry I wasn't very clear. You should have 1 clone of nopCommerce and that is where you work. When nopCommerce adds new features you use Mercurial to pull a changeset from nopCommerce into your 1 clone.

Yes, you will most definitely get to a point where you are required to change views. You can do this by adding your own theme and overriding the views by placing the new one in your theme folder. If overriding views doesn't work for you then you can modify the view directly. It will be a lot easier to take new changes if you do not modify the view directly.

I've also written an article about making modifications to existing nopCommerce entities.

VisualHg is a nice plugin for visual studio. Instead of switching from Visual Studio to Windows Explorer and back you can just work in Visual Studio.
12 years ago
skyler.severns wrote:

...You should have 1 clone of nopCommerce and that is where you work. When nopCommerce adds new features, you use Mercurial to pull a changeset from nopCommerce into your 1 clone.

That's what I've started to do, but I think it gets more complicated than that.  I see it as 2 different kinds of changes being done by the nop team:  1) bug fixes, 2) new features for next release.
I want the bug fixes, but I (typically) don't want any new features yet  - especially any that would require running a SQL update script that has DDL in it.  (Even the scripts that just add new data like localizations, etc. are problematic, because I have to look out for them - i.e. unlike just applying the changeset to the VS code, I've got notice that there is an update.sql, and then manually run the update).
If I decide not to apply a particular changeset, then I run the risk that a later bug fix I want is in some file that was modified in the prior changeset I didn't use - thus dependencies.

skyler.severns wrote:

overriding the views by placing the new one in your theme folder.

That's interesting!  Would you elaborate on that - does the new view file (e.g. .cshtml) need to be in a subfolder the of the same name as original?  e.g.   ...\Themes\DarkOrange\Views\Catalog

EDIT:  Never mind the question - I tried it out, and yes, the folder structure is required:
see my last post in  https://www.nopcommerce.com/boards/t/11206/checkout-stopped-working.aspx?p=3
for more details about customizing views.
12 years ago
I also recommend to look at the following articles/screencats about working with Mercurial and Codeplex:
1. http://blogs.msdn.com/b/codeplex/archive/2010/03/05/codeplex-mercurial-support-for-forks.aspx
2. http://tekpub.com/view/dotnet-oss/7
3. http://shop.tekpub.com/products/hg (unfortunately not free)
12 years ago
Which is the best practice to implement custom class on body tag. I want to apply my custom class name on body tag, this provides me an ability to modify overall site design based on class applied on body tag.

So when page renders, it will have

<body class="class_name">

I want ability to define this class name in view / template file.

I can do this using a simple jquery, but that will apply tag after page renders.
12 years ago
Dharmik wrote:
Which is the best practice to implement custom class on body tag. I want to apply my custom class name on body tag, this provides me an ability to modify overall site design based on class applied on body tag.

So when page renders, it will have

<body class="class_name">

I want ability to define this class name in view / template file.

I can do this using a simple jquery, but that will apply tag after page renders.


The best way to implement such a small change is just as you would normally. Add the class to the element, but remember when the time comes for you to merge in updates you will need to compare files and do a merge to avoid losing your changes.
12 years ago
Thank you for your reply. I'm currently working on a theme, and already have lot of customization on core layout files in my theme.

Apart from that, I want to apply class name on body tag, that will give me ability to control/apply special styles using css. I just don't know how to apply it using MVC in nop commerce? I want to apply it in _Root.cshmll on body tag.

Any help with sample code would be great.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.