Usages of

com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Item.getChangeSetID()
public DiffItem( final Item item, final String localPath, final String tempFile, final DiffItem rootItem, final VersionSpec version) { this( item.getServerItem(), localPath, tempFile, item.getEncoding().getCodePage(), rootItem, item.getItemType(), item.getCheckinDate().getTimeInMillis(), true, version); Check.notNull(item, "item"); //$NON-NLS-1$ this.item = item; changesetVersion = item.getChangeSetID(); }
@Override protected void doRun(final TFSRepository repository) { final Change change = (Change) adaptSelectionFirstElement(Change.class); final Item item = change.getItem(); final Compare compare = new Compare(); compare.setModified(new TFSItemNode(item, repository.getVersionControlClient())); compare.setOriginal( new ServerItemByItemVersionGenerator( repository, new ItemSpec(item.getServerItem(), RecursionType.NONE, item.getDeletionID()), new ChangesetVersionSpec(item.getChangeSetID()), LatestVersionSpec.INSTANCE)); compare.addComparator(TFSItemContentComparator.INSTANCE); compare.setUIType(compareUIType); compare.setExternalCompareHandler(new UserPreferenceExternalCompareHandler(shell)); compare.open(); }
@Override protected void doRun(final TFSRepository repository) { final Change change = (Change) adaptSelectionFirstElement(Change.class); final Item item = change.getItem(); final Compare compare = new Compare(); compare.setModified(new TFSItemNode(item, repository.getVersionControlClient())); compare.setOriginal( new ServerItemByItemVersionGenerator( repository, new ItemSpec(item.getServerItem(), RecursionType.NONE, item.getDeletionID()), new ChangesetVersionSpec(item.getChangeSetID()), new ChangesetVersionSpec(item.getChangeSetID() - 1))); compare.addComparator(TFSItemContentComparator.INSTANCE); compare.setUIType(compareUIType); compare.setExternalCompareHandler(new UserPreferenceExternalCompareHandler(shell)); compare.open(); }
public TFSItemNode(final Item item, final VersionControlClient vcClient) { // code omitted ... @Override public String toString() { return item.getServerItem() + ";C" + item.getChangeSetID(); //$NON-NLS-1$ }
private String getLocalItemToView(final Change change, final TFSRepository repository) { Item item = change.getItem(); if (ViewVersionType.PREVIOUS == viewVersionType || ViewVersionType.LATEST == viewVersionType) { int version; if (ViewVersionType.PREVIOUS == viewVersionType) { version = item.getChangeSetID() - 1; } else { // Latest version = Integer.MAX_VALUE; } item = repository.getVersionControlClient().getItem(item.getItemID(), version, true); } final String localFileName = ServerPath.getFileName(item.getServerItem()); return item.downloadFileToTempLocation(repository.getVersionControlClient(), localFileName).getAbsolutePath(); }
public int getChangeSetID(String path, Pattern[] excludedPatterns, Pattern[] includedPatterns) { Item item = versionClient.getItem(path); int changeSetID = item.getChangeSetID(); if (item.getItemType() == ItemType.FOLDER) { for (Item i : versionClient.getItems(path, RecursionType.FULL).getItems()) { String childPath = i.getServerItem().charAt(0) == '$' ? i.getServerItem().substring(1) : i.getServerItem(); if (excludedPatterns != null && excludedPatterns.length > 0 && isPatterns(childPath, excludedPatterns)) continue; if (includedPatterns != null && includedPatterns.length > 0 && !isPatterns(childPath, includedPatterns)) continue; if (changeSetID < i.getChangeSetID()) changeSetID = i.getChangeSetID(); } } return changeSetID; }
private Item fromItem; // code omitted ... public int getFromItemChangesetID() { return fromItem == null ? 0 : fromItem.getChangeSetID(); }
public VersionedFileDiffLaunchItem(final VersionControlClient client, final Item item, final VersionSpec version) // code omitted ... public Item getItem() throws CLCException { if (item == null) { item = client.getItem(itemID, changeset, true); if (item == null) { if (changeset == -1) { final String messageFormat = Messages.getString("VersionedFileDiffLaunchItem.ItemNotFoundInSourceControlFormat"); //$NON-NLS-1$ final String message = MessageFormat.format(messageFormat, displayPath); throw new CLCException(message); } else { final String messageFormat = Messages.getString("VersionedFileDiffLaunchItem.ItemNotFoundInSourceControlAtVersionFormat"); //$NON-NLS-1$ final String message = MessageFormat.format(messageFormat, displayPath, Integer.toString(changeset)); throw new CLCException(message); } } if (item.getItemType() == ItemType.FOLDER) { throw new CLCException(Messages.getString("VersionedFileDiffLaunchItem.CannotCompareFileWithFolder")); //$NON-NLS-1$ } /* * Changeset -1 and latest are the same. */ if ((version instanceof ChangesetVersionSpec && ((ChangesetVersionSpec) version).getChangeset() == -1) || (version instanceof LatestVersionSpec)) { version = new ChangesetVersionSpec(item.getChangeSetID()); } } return item; }
public void setItem(final Item item) { if (item != null) { itemType = item.getItemType(); itemTypeServerString = item.getItemType().toUIString(); serverItemServer = item.getServerItem(); versionServer = item.getChangeSetID(); deletionID = item.getDeletionID(); /* * TODO Get the server's time zone and convert from it to local * time. */ checkinDateString = FORMATTER.format(item.getCheckinDate().getTime()); if (item.getItemType() == ItemType.FILE && item.getEncoding().equals( new FileEncoding(VersionControlConstants.ENCODING_UNCHANGED)) == false) { encodingString = item.getEncoding().getName(); } fileLength = item.getContentLength(); } }
final Item remoteItem, // code omitted ... @Override public String getContentIdentifier() { /* Changeset number is given in the get operation. */ if (operation != null) { return String.valueOf(operation.getVersionServer()); } /* * Local delete against a 2010 with a conflicting edit. */ else if (remoteItem != null && remoteItem.getChangeSetID() > 0) { return String.valueOf(remoteItem.getChangeSetID()); } /* * No get implies that we're at the latest version locally, use the * local version number. */ else if (pendingChange != null && pendingChange.getVersion() > 0) { return String.valueOf(pendingChange.getVersion()); } /* Remote resource does not exist. */ return Messages.getString("LatestResourceVariant.ContentIdentifierLatest"); //$NON-NLS-1$ }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes