AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 01.06.2017, 11:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
palleagermark: Merge externally modified label files
Источник: http://www.agermark.com/2017/06/merg...bel-files.html
==============

Sometimes you may need to have your label files reviewed or changed by an external party not having access to Visual Studio or your VSTS project.
This is a description of how a developer can merge the external changes back into the version control.

The tool used

You can of course use all sorts of different software to help you compare the files and merge the files. In this description we use the Diff and Merging tool that already comes with Visual Studio. This is the tool you'll see open when you have conflicts between local files and files in the source control repository.

These are the steps

The Diff and Merging tools doesn't have a menu in Visual Studio for opening it. So it must be opened through a command prompt and it must be given parameters about the files you want to work with.

Open Visual Studio

Open Visual Studio as you'd normally do. Remember to open it with "Run as administrator".
Make sure that Visual Studio doesn't have a label dialog open.

Get latest label files

Ensure that your system is updated with the latest label files from the version control.

Open the command prompt

1. Click the Window button:




2. Click the arrow:


3. Scroll to the right until you find the "Developer Command Prompt for VS2015":


4. Right-click it and choose "Run as administrator":


5. This opens the command prompt:



Start the merge tool

The merge tool needs to know of four file names:
  • Source file (in our case the current label file)
  • Target file (in our case this is the external file you have to merge in)
  • Base file (in our case also the current label file)
  • Result file (in our case also the current label file – as this is where we want to store the merge)
The following is an example with labels in a package called "EGDiagnosticsPlatform" and a model called "EG Diagnostics Platform". The external label file has been placed in H:\External.

Here are my changes, shown with another compare tool (Code Compare):


The command prompt looks like this:
vsdiffmerge "J:\AosService\PackagesLocalDirectory\EGDiagnosticsPlatform\EG Diagnostics Platform\AxLabelFile\LabelResources\en-US\EGDiagnosticsPlatform.en-US.label.txt" "H:\External\EGDiagnosticsPlatform.en-US.label.txt" "J:\AosService\PackagesLocalDirectory\EGDiagnosticsPlatform\EG Diagnostics Platform\AxLabelFile\LabelResources\en-US\EGDiagnosticsPlatform.en-US.label.txt" "J:\AosService\PackagesLocalDirectory\EGDiagnosticsPlatform\EG Diagnostics Platform\AxLabelFile\LabelResources\en-US\EGDiagnosticsPlatform.en-US.label.txt" /m

Here it is in the command prompt:





And this is the result:


Note that this way of looking at source vs. target, makes the tool suggest to remove the new labels made in-house while the file has been out for review. This is something you must fix manually.

Not what we want:


Fixed:


Version control

Note how running the tool immediately flagged the label file as a pending change (because we choose it to be the Result file):


PowerShell

If you don't want to have to figure out how to fill the prompt each time do this merge, you could use a PowerShell script like this:


Run PowerShell as Administrator


Go to the location of the script and run it



Enter the location of your internal file and of the external file:

Version with parameters

If you need to merge the same filter repeatedly, you might want another version of the script. If I knew PowerShell better, I'm sure these could be combined, so the script only asks for parameters if they are not given.

The base function


The call of the function


Running it



Источник: http://www.agermark.com/2017/06/merg...bel-files.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
palleagermark: Moving label files between models in AX7 Blog bot DAX Blogs 0 20.07.2016 15:11
german_nav_developer: Buildnummern-Übersicht Microsoft Dynamics NAV 2013 R2 Blog bot NAV: Blogs 0 15.05.2016 18:12
german_nav_developer: Buildnummern-Übersicht Microsoft Dynamics NAV 2013 Blog bot NAV: Blogs 0 15.05.2016 18:12
palleagermark: Quick import of new label files Blog bot DAX Blogs 0 01.07.2015 12:11
palleagermark: How to delete Label Files from AX 2012 Blog bot DAX Blogs 0 22.01.2014 15:11
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 12:56.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.