Package org.locationtech.geogig.api.porcelain.TransferSummary

Examples of org.locationtech.geogig.api.porcelain.TransferSummary.ChangedRef


                    }
                }
                for (Ref localRef : localRemoteRefs) {
                    if (!locals.contains(localRef)) {
                        // Delete the ref
                        ChangedRef changedRef = new ChangedRef(localRef, null,
                                ChangeTypes.REMOVED_REF);
                        needUpdate.add(changedRef);
                        command(UpdateRef.class).setDelete(true).setName(localRef.getName()).call();
                    }
                }
View Full Code Here


                continue;
            }
            Optional<Ref> local = findLocal(remoteRef, localRemoteRefs);
            if (local.isPresent()) {
                if (!local.get().getObjectId().equals(remoteRef.getObjectId())) {
                    ChangedRef changedRef = new ChangedRef(local.get(), remoteRef,
                            ChangeTypes.CHANGED_REF);
                    changedRefs.add(changedRef);
                } else if (depth.isPresent()) {
                    int commitDepth = graphDatabase().getDepth(local.get().getObjectId());
                    if (depth.get() > commitDepth) {
                        ChangedRef changedRef = new ChangedRef(local.get(), remoteRef,
                                ChangeTypes.DEEPENED_REF);
                        changedRefs.add(changedRef);
                    }
                }
            } else {
                ChangedRef changedRef = new ChangedRef(null, remoteRef, ChangeTypes.ADDED_REF);
                changedRefs.add(changedRef);
            }
        }
        return changedRefs;
    }
View Full Code Here

            force = ref.isForceUpdate();

            if (ref.isDelete()) {
                Optional<Ref> deleted = remoteRepo.deleteRef(remoteRefSpec);
                if (deleted.isPresent()) {
                    ChangedRef deleteResult = new ChangedRef(deleted.get(), null, REMOVED_REF);
                    result.add(remote.getPushURL(), deleteResult);
                }
            } else {
                Optional<Ref> localRef = refParse(localRefSpec);
                checkState(localRef.isPresent(), "RefSpec %s does not exist", localRefSpec);

                Optional<Ref> newRef = push(remoteRepo, remote, localRef.get(), remoteRefSpec);

                if (newRef.isPresent()) {
                    ChangeTypes changeType = remoteRefSpec == null ? ADDED_REF : CHANGED_REF;
                    ChangedRef deleteResult = new ChangedRef(localRef.get(), newRef.get(),
                            changeType);
                    result.add(remote.getPushURL(), deleteResult);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.porcelain.TransferSummary.ChangedRef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.